Class ColliderShapeCastHit

The result of a shape-cast that hit a collider.

The frames of the witness points and normals depend on the query that returned it:

  • World.castShape (and BroadPhase.castShape): witness1 and normal1 lie on the hit collider and are expressed in world-space; witness2 and normal2 lie on the cast shape and are expressed in its local-space (relative to its pose, so they do not depend on its translation along the cast).
  • Collider.castCollider: witness1 and normal1 lie on the collider the cast is called on and are expressed in its local-space; witness2 and normal2 lie on the hit collider (the collider2 argument) and are expressed in its local-space.

Hierarchy (view full)

Constructors

Properties

collider: Collider

The collider hit by the shape-cast.

normal1: Vector

The outward normal on the first shape at the time of impact, expressed in the local-space of the first shape.

normal2: Vector

The outward normal on the second shape at the time of impact, expressed in the local-space of the second shape.

time_of_impact: number

The time of impact of the two shapes.

witness1: Vector

The contact point on the first shape at the time of impact, expressed in the local-space of the first shape.

witness2: Vector

The contact point on the second shape at the time of impact, expressed in the local-space of the second shape.

Methods