@pmndrs/bvh
    Preparing search index...

    Interface BvhShapecastCallbacks<Triangle, Box>

    The callbacks of CpuMeshBvh.shapecast: three-mesh-bvh's shapecast callbacks (0.9.18), with its argument order and meaning. Box is what the boxes come as (a BvhBox3 here, a three Box3 in @pmndrs/bvh/three), Triangle what the triangles come as (an ExtendedTriangle here, the three-flavoured one there). Both are scratch objects, valid only during the call.

    interface BvhShapecastCallbacks<Triangle = BvhQueryTriangle, Box = BvhBox3Like> {
        boundsTraverseOrder?(box: Box): number;
        intersectsBounds(
            box: Box,
            isLeaf: boolean,
            score: number | undefined,
            depth: number,
            nodeIndex: number,
        ): unknown;
        intersectsRange?(
            offset: number,
            count: number,
            contained: boolean,
            depth: number,
            nodeIndex: number,
            box: Box,
        ): unknown;
        intersectsTriangle?(
            triangle: Triangle,
            triangleIndex: number,
            contained: boolean,
            depth: number,
        ): unknown;
    }

    Type Parameters

    Index
    • As BvhTraverseCallbacks.intersectsBounds, with the box as Box.

      Parameters

      • box: Box
      • isLeaf: boolean
      • score: number | undefined
      • depth: number
      • nodeIndex: number

      Returns unknown

    • A range of tree positions, before its triangles are handed to intersectsTriangle; a truthy return stops the cast (and skips them). Without intersectsTriangle it decides alone. With neither, a cast stops at the first contained box (three-mesh-bvh's default).

      Parameters

      • offset: number
      • count: number
      • contained: boolean
      • depth: number
      • nodeIndex: number
      • box: Box

      Returns unknown

    • Each triangle of an entered leaf or a contained box, in tree order: triangleIndex is the original index, contained whether a box above it was reported contained. A truthy return stops the cast.

      Parameters

      • triangle: Triangle
      • triangleIndex: number
      • contained: boolean
      • depth: number

      Returns unknown