Using Three Mesh BVH on server side

I’ve enjoyed my time using three-mesh-bvh so far, getting a character to run and jump around, even wall-riding, and hoping to work on grinding like on a skateboard or rollerblades.

What I’ve liked most so far is how collision, at least with the way I am using three-mesh-bvh, is automatically handled. I only need arcadey physics and have been implementing my own movement rules, with no need for a physics engine.

I do have some aspirations to make what I have into a multiplayer experience, but that under my current usage would require three-mesh-bvh to run on server side to reference as the one-source-of-truth. I’ve seen some threads on the topic of Server Side Rendering, although they seem only for taking snapshots rather than running a constant loop, and from what I understand requires GPU power which isn’t ideal IMO.

My hope is to provide enough to run just three-mesh-bvh in the server for the sake of collision and my movement logic. Is this possible? And if not, are physics engines capable of automatically settling collision from meshes like three-mesh-bvh can?

Both BVH generation and CPU-based raycasting and geometry queries can run just fine in node.js without much effort.

2 Likes

@gkjohnson Thank you for the clarification. I also wanted to extend another thank you for creating and providing the three-mesh-bvh library.

Does this also work with constant checking of intersecting meshes?

1 Like

All CPU-queries will work just fine in node. There are no special browser APIs used.