API

Class ShapeCastResult

Class representing a contact point produced in a shape cast

Hierarchy

  • CastingResult
    • ShapeCastResult
Index

The Physics body that the query hit.

bodyIndex?: number

The body Index in case the Physics body is using instances

shape?: PhysicsShape

The shape hit by the query.

  • get triangleIndex(): number

    The index of the original triangle which was hit. Will be -1 if contact point is not on a mesh shape

    Returns number

  • Sets the hit data

    Parameters

    • hitNormal: IXYZ

      defines the normal in world space

    • hitPoint: IXYZ

      defines the point in world space

    • OptionaltriangleIndex: number

      defines the index of the triangle in case of mesh shape

    Returns void