gkjohnson / three-mesh-bvh

A BVH implementation to speed up raycasting and enable spatial queries against three.js meshes.
https://gkjohnson.github.io/three-mesh-bvh/example/bundle/raycast.html
MIT License
2.39k stars 247 forks source link

[Idea Discussion] using bvh for cannon-es trimesh (octree) Implementation #253

Closed arpu closed 3 years ago

arpu commented 3 years ago

Hey,

cannon-es has a very good octree implementation for mesh collision ( using Trimesh) https://github.com/pmndrs/cannon-es/blob/master/src/shapes/Trimesh.ts

would it make sense to try bvh in this field?

gkjohnson commented 3 years ago

Hey @arpu! Can you elaborate on what you mean? What are you looking for / trying to do?

Are you asking if three-mesh-bvh can be used to detect mesh intersections?

arpu commented 3 years ago

Hey yes, idea to speed up the octree?

gkjohnson commented 3 years ago

I'm unfamiliar with the details of cannon-es and unfortunately don't have the time to investigate performance improvements for another package. If you have a specific implementation question I'm happy to answer but you should open an issue in cannon-es if you'd like them to improve performance of the octree or look into a different type of spatial data structure to represent the trimesh and you can ping me there if needed.