The intersection between a ray and a collider.

Constructors

  • Parameters

    • timeOfImpact: number
    • normal: Vector
    • Optional featureType: FeatureType
    • Optional featureId: number

    Returns RayIntersection

Properties

featureId: number

The id of the geometric feature the point was projected on.

featureType: FeatureType

The type of the geometric feature the point was projected on.

normal: Vector

The normal of the collider at the hit point.

timeOfImpact: number

The time-of-impact of the ray with the collider.

The hit point is obtained from the ray's origin and direction: origin + dir * timeOfImpact.

Methods

  • Parameters

    • raw: RawRayIntersection

      The raw intersection returned by the WASM query. It is freed by this method.

    • Optional target: RayIntersection

      If provided, this object is populated and returned instead of allocating a new one.

    Returns RayIntersection