three-mesh-bvh
three-mesh-bvh copied to clipboard
Add "indirectBuffer" option
Fix #294
Also fixed web worker not transferring root buffers.
TODO
- [x] Index no longer has to be ensured (
buildTree
function) - [x] Instead of bookkeeping an index array we keep an indirect "triangleIndex" array that is 1/3 the size (
buildTree
function) - [x] "partition" function needs to sort an array that is 1 / 3 the size (
partition
function) - [x] "raycast" function needs to be adjusted to take an indirect array or take function for running intersections (
raycast
cast function) - [x] "raycastFirst" function needs to be adjusted to take an indirect array or take function for running intersections (
raycastFirst
cast function) - [x] Worker generation / serialization
- [ ] "shapecast" functions needs to be adjusted to take an indirect array or it can be wrapped in MeshBVH call (
MeshBVH.shapecast
orshapecast
cast function) - [ ] Fix "bvhcast" function
- [ ] Shader BVH packing needs to know about the indirect storage.
- deindex the buffer here
- [ ] Adjust code to be agnostic to index presence.
- [ ] Tests
- [x] Randomized tests
- [ ] Serialized tests
- [ ] Removed index tests
- [ ] Option tests
- [ ] Performance
This touches a lot more than I thought it might and the value may not be that high for the applications I initially anticipated. Putting on hold for now