Can;t apply force to rigid body over a heightmap

the code apply a force upwards the barrel when it gets hit, it works well with planar ground but not with heightmaps

Can you provide a Playground example where it “works well” in regular ground but not on a height map? I’ve set up an example in a heightmap and it works exactly the same as with a flat ground:
Heightmap demo physics engine | Babylon.js Playground (
Heightmap demo physics engine | Babylon.js Playground (

I am using Ammo so there is no HeightMap Impostor, i am using a custom function to calculate the heightmap vertices, maybe this is the problem.
I just setup ammo to show you a brief repro of the problem even without doing vertex calcularions, the barrel now doesn’t react to the impulse

I am seriously thinking of change the physics engine, does havok support heightmap impostors?

Apply an impulse to the impostor and it works:

 cyl.physicsImpostor.applyImpulse(new BABYLON.Vector3(0,10,0), new BABYLON.Vector3(0,0,0));

Please check documentation and samples : Forces | Babylon.js Documentation

1 Like