A triangle-precise ray hit against a SceneObject mesh.

Returned by intersectSceneRayTriangle and surfaced through SceneRaycaster.pick as the value of a successful hit.

interface SceneTriangleHit {
    meshId: string;
    objectId: string;
    tHit: number;
    triangleIndex: number;
    worldPos: Vec3Float;
}

Properties

meshId: string

ID of the SceneMesh the triangle belongs to.

objectId: string

ID of the SceneObject the triangle belongs to.

tHit: number

Parametric distance along the input ray, in dir-multiples. The hit point equals origin + dir * tHit (modulo the same floating-point round-off as any other ray test).

triangleIndex: number

Index of the hit triangle (offset into geometry.indices divided by 3).

worldPos: Vec3Float

World-space hit point.