Constants
On this page
Constants
const CENTER: numberOption for splitting each BVH node down the center of the longest axis of the bounds.
This is the fastest construction option and will yield a good, performant bounds.
const AVERAGE: numberOption for splitting each BVH node at the average point along the longest axis for all triangle centroids in the bounds.
This strategy may be better than CENTER with some geometry.
const SAH: numberOption to use a Surface Area Heuristic to split the bounds more optimally. This SAH implementation tests 32 discrete splits in each node along each axis to determine which split is the lowest cost.
This is the slowest construction option but will yield the best bounds of the three options and use the least memory.
const NOT_INTERSECTED: numberIndicates the shape did not intersect the given bounding box.
const INTERSECTED: numberIndicates the shape did intersect the given bounding box.
const CONTAINED: numberIndicate the shape entirely contains the given bounding box.
Shader and Texture Packing API
const bvh_distance_functions: stringSet of shader functions used for interacting with the packed BVH in a shader and sampling VertexAttributeTextures. Provides distance query functions. See src/webgl/glsl for full implementations and declarations.
Accessed as BVHShaderGLSL.bvh_distance_functions.
const bvh_ray_functions: stringSet of shader functions used for interacting with the packed BVH in a shader and sampling VertexAttributeTextures. Provides ray intersection functions. See src/webgl/glsl for full implementations and declarations.
Accessed as BVHShaderGLSL.bvh_ray_functions.
const bvh_struct_definitions: stringSet of shader structs and defined constants used for interacting with the packed BVH in a shader. See src/webgl/glsl/bvh_struct_definitions.glsl.js for full implementations and declarations.
Accessed as BVHShaderGLSL.bvh_struct_definitions.
const common_functions: stringSet of shader functions used for interacting with the packed BVH in a shader and sampling
VertexAttributeTextures. Provides common utility functions including texelFetch1D. See
src/webgl/glsl
for full implementations and declarations.
Accessed as BVHShaderGLSL.common_functions.