docsby gkjohnson
On this page

Debug Functions

type BVHExtremes = {
	// Total number of nodes in the tree including leaf nodes.
	nodeCount: number,

	// Total number of leaf nodes in the tree.
	leafNodeCount: number,

	// Total tree score based on the surface area heuristic. Lower is better. Useful for comparing tree quality and performance, and for detecting degradation after `MeshBVH.refit` calls.
	surfaceAreaScore: number,

	// Min and max depth of leaf nodes.
	depth: Object,

	// Min and max triangle count in leaf nodes.
	tris: Object,

	// Number of splits on each axis as a three-element array `[X, Y, Z]`.
	splits: Array<number>
}
function getBVHExtremes( bvh: MeshBVH ): Array<BVHExtremes>
function estimateMemoryInBytes( bvh: BVH ): number
function validateBounds( bvh: MeshBVH ): boolean
function getJSONStructure( bvh: BVH ): Object

Extension Utilities

function acceleratedRaycast(
	raycaster: Raycaster,
	intersects: Array<Intersection>
): void
Casting a thousand rays at a mesh every frame
Data courtesy of Stanford 3D Scanning Repository
function computeBoundsTree( options?: Object ): GeometryBVH
function disposeBoundsTree(): void
function computeBatchedBoundsTree(
	index: number = -1,
	options?: Object
): GeometryBVH | Array<GeometryBVH> | null
function disposeBatchedBoundsTree( index: number = -1 ): void

Functions

function getTriangleHitPointInfo(
	// The point on the triangle surface (in the geometry's local space).
	point: Vector3,

	// The geometry containing the triangle.
	geometry: BufferGeometry,

	// The index of the triangle within the geometry.
	triangleIndex: number,

	// Optional object to write results into. Reuses existing `face`, `uv`, and `barycoord` sub-objects if present.
	target?: HitTriangleInfo
): HitTriangleInfo