public sealed class PhysicsOcclusionA raycast against the physics world.
Remarks
⚠ Two bodies have to be got out of the way and they are handled differently. The listener's own body is excluded by the query, because the eye is usually inside its own capsule and a ray that starts inside a convex shape is not reliably outside it. The source's body cannot be excluded — the closest hit being the source is the affirmative answer — so it is compared against instead. Excluding both would report a clear line to something standing behind a wall whose collider the source is inside.
The layer mask is here rather than on SightSettings. Which layers block sight is a fact about the physics world, and a settings record that carried one would be a settings record that cannot be used by OpenSightlines.
Fields and properties (1)
public PhysicsLayerMask BlockersWhich layers stop sight.
Methods (2)
public PhysicsOcclusion(PhysicsWorld physics, PhysicsLayerMask? blockers = null)A raycast against the physics world.
public bool IsClear(World world, Entity listener, Entity source, Vector3 from, Vector3 target)Whether the line between two points is clear.
Used by (1)
- SightOcclusionTestsVixen.Ai.Perception.Tests