Hi everyone,
I want to make physical objects collide with the complex terrain in the loaded glb file.
However, MeshImpostor does not cause collisions no matter which physics engine is used. https://playground.babylonjs.com/#1NQ0JU
I considered the collision feature built into babylon.js, but I can’t reproduce bounces and such with moveWithCollisions.
Would I need to prepare a separate simple mesh to achieve collision?
yes, it’s difficult to debug with that much meshes ans so many triangles/vertices. Can you provide a simpler glb with less mesh, or merged meshes? The best would be to provide a simplified mesh for collision detection/physics. Even without physics enabled, rendering is slow.
Using this, is it possible to use babylon.js built-in collision function only for collision detection, and use physics engine for the rest?
If anyone has done something similar, please let me know.
The first one is (mostly) for camera/mesh collision detection and mesh/mesh collision detection.
The second one compute dynamics from collision detection.
It might be a bit delicate to mix both world. Usually, physics engine is favored because it allows more things like collision response.
Thanks for letting me know that mixing the 2 types of collisions is delicate.
I’m going to give up on mixing collisions and try to see if I can simplify the mesh to make it collide.
I found a way to fix it.
I used AmmoJSPlugin to apply MeshImpostor to the root mesh, regardless of the number of getTotalVertices.
But, this will cause Out Of Memory (OOM), so we need to increase the memory used by Ammo.js.
Based on the descriptions here, I set TOTAL_MEMORY to 512MB, built, and used the created ammo.js, and a collision occurred.
I hope this helps someone out there!