@pmndrs/bvh
    Preparing search index...

    Class BVHHelper

    three-mesh-bvh's BVHHelper: draws bvh (or mesh.geometry.boundsTree) as boxes down to depth, placed on mesh (its world matrix, and an instance's with instanceId for an InstancedMesh or BatchedMesh). Call update after changing the tree, depth, displayParents or displayEdges. Our trees have one root, so there is one child.

    Constructor: (mesh), (mesh, depth), (bvh, depth) or (mesh, bvh, depth); depth defaults to 10.

    Hierarchy (View Summary)

    Index
    • Parameters

      • OptionalmeshOrBvh: Object3D<Object3DEventMap> | BvhHelperTree | null
      • OptionalbvhOrDepth: number | BvhHelperTree | null
      • depth: number = 10

      Returns BVHHelper

    bvh: BvhHelperTree | null
    depth: number
    displayEdges: boolean = true
    displayParents: boolean = false
    edgeMaterial: LineBasicMaterial
    instanceId: number = 0
    mesh: Object3D<Object3DEventMap> | null
    meshMaterial: MeshBasicMaterial
    • get color(): Color

      edgeMaterial.color, shared with meshMaterial.

      Returns Color

    • get opacity(): number

      Both materials' opacity.

      Returns number

    • set opacity(value: number): void

      Parameters

      • value: number

      Returns void

    • Returns a clone of this object and optionally all descendants.

      Returns this

    • Copies the given object into this object.

      Parameters

      • source: this
      • Optionalrecursive: boolean

        If set to true, descendants of the object are copied next to the existing ones. If set to false, descendants are left unchanged. Default is true.

      Returns this

      Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

    • Disposes of the materials and the box geometry.

      Returns void

    • Rebuilds the boxes from the tree as it is now, with the current depth, displayParents and displayEdges.

      Returns void

    • Follows the mesh: its world matrix relative to this helper's parent (and the instance's matrix).

      Parameters

      • Optionalforce: boolean

      Returns void