Documentation - v19.12.0-dev
    Preparing search index...

    Class BoxTree<TObject>

    Flat-buffer bounding-volume hierarchy over raycastable scene objects, used for picking and proximity queries (raycast, intersectPoint). It is not updated automatically: moving or resizing an item requires calling updateItem, or the tree keeps stale bounds while the object renders at its new place.

    Type Parameters

    Index

    Constructors

    Properties

    buffer: SharedArrayBuffer

    Buffer storing the tree data

    f32: Float32Array

    Float32 view of the buffer

    i32: Int32Array

    Int32 view of the buffer

    isBoxTree: true

    Accessors

    • get size(): number

      Returns number

    Methods

    • Parameters

      Returns void

    • Parameters

      • options: { leavesOnly?: boolean; maxDepth?: number } = {}

      Returns number

    • Copies the allocated part into a dedicated shared buffer and resolves leaf objects to stable identifiers. Mutating the returned buffer cannot mutate the live scene tree.

      Type Parameters

      • TIdentifier extends string | number

      Parameters

      Returns BoxTreeSnapshot<TIdentifier>

    • Parameters

      • target: Box3

      Returns Box3

    • Parameters

      Returns boolean

    • Read a single node by slot index. Thin wrapper around the standalone readNodeFromBuffer.

      Parameters

      Returns BoxTreeNode

    • Parameters

      Returns void

    • Returns void

    • Parameters

      • callback: (node: BoxTreeNode, index: number, depth: number) => void
      • options: { leavesOnly?: boolean; maxDepth?: number } = {}

      Returns void

    • Parameters

      Returns void

    • Write a node back into the buffer at the given slot index. Thin wrapper around the standalone writeNodeToBuffer.

      Parameters

      Returns void