Wall collision ammo.js

I have a map that I want to export from blender to glb but I wonder what is the best way to create a collision between this and the players or the camera … I have been using ammo.js but I do not know if it would be the best option compared to cannon. js or other physics engine

I know that in a simjple map like this I could manually create walls with boxes and imposter but I want to know if there is any automatic or faster way to create collisions in more complex maps

Hey,

you can probably rely on MeshImpostor for physics.
For camera collision, you can read more here: https://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity

thank you for answering and if I have to use impostor but my question is if there is a way to create them automatically for each wall, floor, staircase, etc … of a model exported from blender to avoid having to create boxes one by one in some complex model by example something like the following:

87345

The meshImpostor works well when the mesh is complicated. In your case I would recommend to export invisible boxes from Blender (with a special name like “impostorXX”) and then automatically retrieve them at runtime to add a BoxImpostor. It will be definitely faster

2 Likes