Skip to content

Dynamic BVH implementation based on Erin Catto's paper and three-mesh-bvh (WIP)

License

Notifications You must be signed in to change notification settings

agargaro/BVH.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic BVH

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
closestPointToGeometry
getAllCollision
getNearestObject

experiment rotation with N leaves and max depth

References