new BVH(branchingFactor, primitivesPerNode, depth)
Constructs a new BVH.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
branchingFactor |
Number | 2 | The branching factor. |
primitivesPerNode |
Number | 1 | The minimum amount of primitives per BVH node. |
depth |
Number | 10 | The maximum hierarchical depth. |
Members
-
branchingFactor :Number
-
The branching factor (how many nodes per level).
- Default Value:
- 2
-
depth :Number
-
The maximum hierarchical depth.
- Default Value:
- 10
-
primitivesPerNode :Number
-
The minimum amount of primitives per BVH node.
- Default Value:
- 10
-
root :BVHNode
-
The root BVH node.
- Default Value:
- null
Methods
-
fromMeshGeometry(geometry) → {BVH}
-
Computes a BVH for the given mesh geometry.
Parameters:
Name Type Description geometry
MeshGeometry The mesh geometry.
-
traverse(callback) → {BVH}
-
Executes the given callback for each node of the BVH.
Parameters:
Name Type Description callback
function The callback to execute.