[SOLVED] Update terrain collision mesh

I’ve got a vehicle which can shoot bullets that deform the terrain. The terrain collider doesnt update to reflect that.

How do I update the collider shapes?

1 Like

oh, i remember i have done it before, but not sure about easy way now. (and i got extended version of JME terrain, so cant check in code)

But generally you can always just remove rigidBodyControl as control and from physics space, and then re-add it so it will update.

Since you add control, you can also remove it.

this.terrain.addControl(new RigidBodyControl(0));

and since you need add to physics space as i remember, so remove it


and then re-add.

tip: remember about frictions/etc

    rigidBodyControl.setFriction(friction); 0 to 1
    rigidBodyControl.setRestitution(restitution); //bounciness

Its a bit hacky but that worked! Appreciate it.

1 Like