@pmndrs/bvh
    Preparing search index...

    Interface TraceInstance

    One placed copy of a mesh, as the top-level builder sees it.

    interface TraceInstance {
        contributesToGi?: boolean;
        instanceIndex: number;
        mask?: number;
        material?: number;
        merged?: boolean;
        meshBounds: ArrayLike<number>;
        nodeOffset: number;
        objectToWorld: Mat4;
        triangleOffset: number;
        visible?: boolean;
    }
    Index
    contributesToGi?: boolean

    Defaults to true. An instance can be drawn but hidden from GI, or the reverse.

    instanceIndex: number

    The platform instance index. Comes back as BvhHit.instance.

    mask?: number

    The instance mask, 8 bits (0-255), stored in bits 8-15 of the record's flags. A masked trace skips the instance when (mask & rayMask) == 0. Defaults to 0xff, visible to every ray.

    material?: number

    The instance's material index (0 to MAX_MATERIAL, 65534), reported as BvhHit.material for triangles without one of their own (MeshInput.triangleMaterials); stored as material + 1 in bits 16-31 of the record's flags. Omitted (or NO_MATERIAL): none, and hits report NO_MATERIAL. Anything else is a RangeError. A merged record may not have one: its triangles carry their sources' materials.

    merged?: boolean

    A merged mesh of static instances (static-merge.ts): the record gets INSTANCE_FLAG.merged, and hits take their instance from the triangle. Its transform must be the identity; anything else throws, because the sources' transforms are baked into the mesh. assembleTraceScene sets it. This only catches the group's own record moving; a merged source that moved is only caught when the scene is assembled again.

    meshBounds: ArrayLike<number>

    The mesh's object-space box: [minX, minY, minZ, maxX, maxY, maxZ].

    nodeOffset: number

    Where this mesh's nodes start in the shared node buffer, counted in nodes.

    objectToWorld: Mat4

    Object-to-world, column-major 4x4 (affine; mirrors and non-uniform scales allowed).

    triangleOffset: number

    Where this mesh's triangles start in the shared triangle buffer, counted in triangles.

    visible?: boolean

    Defaults to true.