@pmndrs/bvh
    Preparing search index...

    Interface CpuSceneShapecastCallbacks<Box>

    The callbacks of CpuSceneBvh.shapecast: three-mesh-bvh's ObjectBVH.shapecast callbacks (0.9.18) with its argument order, the object named by its instance's instanceIndex. Box is what the boxes come as (a BvhBox3 here, a three Box3 in @pmndrs/bvh/three).

    interface CpuSceneShapecastCallbacks<Box = BvhBox3Like> {
        boundsTraverseOrder?(box: Box): number;
        intersectsBounds(
            box: Box,
            isLeaf: boolean,
            score: number | undefined,
            depth: number,
            nodeIndex: number,
        ): unknown;
        intersectsInstance?(
            instanceIndex: number,
            contained: boolean,
            depth: number,
        ): unknown;
        intersectsRange?(
            offset: number,
            count: number,
            contained: boolean,
            depth: number,
            nodeIndex: number,
            box: Box,
        ): unknown;
    }

    Type Parameters

    Index
    • Scores a box, once per child; the lower score is entered first.

      Parameters

      Returns number

    • As CpuMeshBvh.traverse's: whether to enter a world box (falsy skips it, BVH_CONTAINED takes its subtree whole).

      Parameters

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

      Returns unknown

    • Each instance of an entered leaf or a contained box, by instanceIndex. A truthy return stops the cast.

      Parameters

      • instanceIndex: number
      • contained: boolean
      • depth: number

      Returns unknown

    • A range of top-level positions (CpuSceneBvh.instanceAt), before its instances; a truthy return stops the cast.

      Parameters

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

      Returns unknown