bvh0.5.0 • Public • Published
Bounding volume hierarchy data structure library written in TypeScript. Specifically implemented for 3-dimensional points.
const BVHBuilderAsync BVHVector3 = ;// Have an array of faces (array of stride 9)const faceArray =00 00 00 // Normal triangle00 00 1010 00 00;// Generate the Bounding Volume Hierachy from an array of facesconst maxTrianglesPerNode = 5;const BVH =;// Find ray intersectionsconst intersections = BVH;
Bounding Volume Hierarchies trade memory for ray intersection computation speed.
- If you are not memory bound, you will want a low maxTrianglesPerNode to minimize intersection speed.
- As you decrease maxTrianglesPerNode, a log/log relationship vs the number of nodes created is observed.
- At 1 maxTrianglesPerNode you get the fastest ray intersection speed, but have the highest memory overhead.
http://localhost:8080/ to see a local copy of the GitHub Pages.
- Be asyncronous when possible.
- Be efficient with memory.
- Be fast when intersecting.
Original Copyright (c) 2015 Ben Raziel.
Modified Copyright (c) 2018 Josh Callebaut.