API

Interface ShapeCastResult

Result of a shapeCast query.

interface ShapeCastResult {
    fraction: number;
    hasHit: boolean;
    hitNormal: Vec3;
    hitPoint: Vec3;
    inputHitNormal: Vec3;
    inputHitPoint: Vec3;
}
Index
fraction: number

Fraction along the sweep (startPosition→endPosition) where contact first occurs.

hasHit: boolean

Whether the swept shape hit a body.

hitNormal: Vec3

Surface normal at the hit-body contact.

hitPoint: Vec3

Contact point on the hit body (world space).

inputHitNormal: Vec3

Surface normal at the swept-shape contact.

inputHitPoint: Vec3

Contact point on the swept shape (query-shape space).