Interface RaycastResult
interface RaycastResult {
body: PhysicsBody | null;
bodyIndex: number;
hasHit: boolean;
hitDistance: number;
hitNormal: Vec3;
hitPoint: Vec3;
triangleIndex: number;
}
body: PhysicsBody | null;
bodyIndex: number;
hasHit: boolean;
hitDistance: number;
hitNormal: Vec3;
hitPoint: Vec3;
triangleIndex: number;
}
Properties
body
The body that was hit, or null when nothing was hit (or the body is not tracked).
body Index
bodyIndex: number
Thin-instance index of body; 0 for an ordinary body and -1 when no tracked body was resolved.
has Hit
hasHit: boolean
Whether the ray hit a body.
hit Distance
hitDistance: number
Distance from the ray origin (from) to the contact point.
hit Normal
Surface normal at the contact point.
hit Point
World-space contact point.
triangle Index
triangleIndex: number
Index of the triangle hit on a MESH shape, or -1 for non-mesh shapes.
Result of a physicsRaycast query.