AccelerationStructure
is the functional element of the bottom-level acceleration
structure. Each individual object will have it’s own BVH, encapsulated by an
AccelerationStructure
object.
Constructors
constructor
- bvh: The backing BVH as a MeshBVH
Accessors
bvh
geometry
When building a BVH, three-mesh-bvh library needs a three.js geometry as
input. This is that geometry. We don’t use it for rendering.
Methods
buildBVH
- indices: Geometry indices
- position: Geometry vertex positions
- options: BVHOptions
- optional transform: A Matrix4 that transforms the geometry data before building the BVH
getBoundingBox
- optional target: Box3
getVertexAtIndex
- index: number
raycast
- ray: Ray to intersect with
- materialOrSide: Side | Material | Material[]
raycastFirst
raycast
but stops at first intersection found.
Parameters
- ray: Ray to intersect with
- materialOrSide: Side | Material | Material[]
shapecast
- callbacks: More details here
transformInput
All the AccelerationStructure methods that deal with querying the BVH:
getBoundingBox,
getVertexAtIndex,
raycast,
raycastFirst,
shapecast already call
this function implicitly.
transformOutput
- input: Vector3 | Ray | Box3
All the AccelerationStructure methods that deal with querying the BVH: getBoundingBox, getVertexAtIndex, raycast, raycastFirst, shapecast already call this function implicitly.