HUD and Height Changes
This commit is contained in:
@@ -35,6 +35,24 @@ namespace ProjectM.Simulation
|
||||
d.y = 0f;
|
||||
return math.lengthsq(d) <= range * range;
|
||||
}
|
||||
/// <summary>
|
||||
/// Projects a planar movement <paramref name="vel"/> onto a wall plane defined by <paramref name="surfaceNormal"/>
|
||||
/// (collide-and-slide): removes the component of <paramref name="vel"/> that pushes into the surface so the
|
||||
/// mover glances along the wall instead of stopping dead. Both inputs are flattened to the XZ plane (top-down).
|
||||
/// Returns <paramref name="vel"/> unchanged when the normal is degenerate.
|
||||
/// </summary>
|
||||
public static float3 SlideVelocity(float3 vel, float3 surfaceNormal)
|
||||
{
|
||||
surfaceNormal.y = 0f;
|
||||
float len = math.length(surfaceNormal);
|
||||
if (len < 1e-6f)
|
||||
return vel;
|
||||
float3 n = surfaceNormal / len;
|
||||
float3 slid = vel - math.dot(vel, n) * n;
|
||||
slid.y = 0f;
|
||||
return slid;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Deterministic planar ring position around <paramref name="center"/> for spawn
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Unity.Entities;
|
||||
|
||||
namespace ProjectM.Simulation
|
||||
{
|
||||
/// <summary>
|
||||
/// Singleton holding the physics-filter mask of the static world-collision layer ("Environment"): the baked
|
||||
/// boundary ring + landmark colliders the player CC sweeps. Baked from the GameObject layer at edit-time (see
|
||||
/// WorldCollisionAuthoring) so server systems can build a <c>CollisionFilter</c> in Burst WITHOUT a managed
|
||||
/// <c>LayerMask.NameToLayer</c> call or a hardcoded layer index. Read by <see cref="ProjectM.Server"/>'s
|
||||
/// EnemyAISystem to sweep-test Husk movement against the environment only (never the player / other Husks).
|
||||
/// </summary>
|
||||
public struct WorldCollisionConfig : IComponentData
|
||||
{
|
||||
/// <summary>BelongsTo bitmask of the Environment physics layer (<c>1u << layerIndex</c>).</summary>
|
||||
public uint EnvironmentMask;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70c75b96478d39f43aca221c926c9561
|
||||
Reference in New Issue
Block a user