Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.65 KB

README.md

File metadata and controls

56 lines (40 loc) · 1.65 KB

BVH.js

npm Quality Gate Status DeepScan grade Stars BundlePhobia

Work in progress... will be released soon :)

Live example: https://stackblitz.com/edit/three-ezinstancedmesh2-dynamic-bvh?file=index.ts

Create a BVH from a AABB array. You can set whetever value to each node.

Build method: top-down or insertion one by one.

Implemented API:

createFromArray
insert
insertRange
move
delete
clear

traverse
rayIntersections
frustumCulling
frustumCullingLOD
closestPointToPoint
intersectsBox
intersectsSphere
intersectsRay
isNodeIntersected

TODO:

traverseByScore
intersectsRayFirst
intersectsBVH
closestPointToBVH
getAllCollision
getNearestObject

experiment rotation with N leaves and max depth

References