three-mesh-bvh
three-mesh-bvh copied to clipboard
A BVH implementation to speed up raycasting and enable spatial queries against three.js meshes.
Could be useful for generating 3d SDF textures, at least.
- remove textureSize - remove branch for early "any hit" logic - add function for transforming ray separate from ndc logic
- \* Understand if there's a reason the first several frames of raycasting into the sky don't happen almost immediately. Is raycasting and missing everything that slow? Can it be...
Currently the shapecast results can't know which material index is associated with a triangle meaning the `closestPointToPoint` and `closestPointToGeometry` functions can't return the appropriate material index. We can pass the...
The raycast results should also return the barycentric coordinates and triangle index so interpolated vertex attributes can be easily retrieved. Should normal, face.a, face.b, face.c, and UV all be included,...
Upgrade the logic in point cloud example to be officially supported and adjust the BVH building logic to support points and improve the memory footprint over the example workaround that...
Relate to #99 Provide a general utility function similar to [shapecast](https://github.com/gkjohnson/three-mesh-bvh/blob/a39226141f8df0dc6d3673c329b60ad2507dab3d/src/castFunctions.template.js#L126) that can more optimally recursively compare child bounds of each tree, stepping down one level at each iteration, and...
See implementations in this repo: - Triangle intersects triangle: [here](https://github.com/juj/MathGeoLib/blob/97a78cdd429f33a7c074fd0d7649012eec20d43a/src/Geometry/Triangle.cpp#L540) - Triangle intersects Sphere: [here](https://github.com/juj/MathGeoLib/blob/97a78cdd429f33a7c074fd0d7649012eec20d43a/src/Geometry/Triangle.cpp#L502) - Triangle closest Point: [here](https://github.com/juj/MathGeoLib/blob/master/src/Geometry/Triangle.cpp#L895) - OBB / AABB Box intersection? - OBB / AABB...
Related to #132 Refitting references [here](http://www.sci.utah.edu/~wald/Publications/2007/ParallelBVHBuild/fastbuild.pdf).
- Number of nodes at depth d: `2^d` - Best case number of leaf nodes: `Math.min( Math.ceil( tris / maxTrisPerNode ), maxDepth )` - It's likely to be worse, though,...