I’m currently working on a small arcade sky game and i’m struggling a bit with the physics engines.
First, I need to switch the engine back to Cannon JS in order to be able to use HeightmapImpostor which seems to work only with this engine. Am I right on this point ? What I want to do is import a mesh from blender and use it as the ground in my physics engine. Don’t know if it’s the best way to do that.
Second, as I want to switch back I tried to just replace the script import in the head of my html file and removed AmmoJSPlugin + the import of the plugin in scene.enablePhysics. I thought that doing so was ok but now, it’s like I don’t have any gravity. Do you know what’s wrong in this case?
Here is a link to my demo with Ammo JS and with Cannon I would have prefer to put it in the playground but I don’t know how to import my glb file in it.
Thanks for your answer Givo but I already tried that solution and it did not work unfortunately ( I modified my code to add your modification Babylon - Getting Started ).
Could it come from a difference in a way of using Babylon JS (declaring mesh and impostor, manipulating physics ) when using one plugin or the other ?
I know some properties don’t transfer from one engine to another. Also, make note that the mesh impostors for cannon only collide with spheres and planes.
Thanks for your answer Givo,
I will try yo rewrite it step by step (refactoring along also) and find the missing / faulty properties.
Just to make shure that I’m not trying to do something impossible or undesirable with Babylon : If you wanted to have a custom ground with bump and hole with low poly flavor, would you use HeightmapImpostor or something else ? Knowing that the physics impostor on my “skier” mesh are sphere ?
I’m doing something quite similar using blender to generate a heightmap and using babylon to create a mesh from the heightmap and then using the mesh imposter in ammo for the physics. So I’d say your on the right track, so dont give up yet!
Hello @Mr_K,
Thanks for your answer Don’t worry i’m not giving up
Currently I’m working on another mini game in Babylon.js (less ski more basketball) and I’m planning to comeback to this one once I’ll complete the other !
Thank you for the advice on using an heightmap then the MeshImpostor in order to generate a physics impostor, I’ll surely try that ! Also, I’m really interested on how you are generating an height map from Blender. I found some tutorials online about that but they were old or seemed hacky to me (but maybe they are not and I don’t understand it as a blender newbie).