AmmoJSPlugin and setSubTimeStep(): Different results?

Please see Babylon.js Playground

A larger number of steps seems to make the simulation more magnetic. Is that the desired behavior?

You can see a great explanation from Cedric here: Physics: should setSubTimeStep speed up simulation?

1 Like

I think the issue @maz and I are seeing is that restitution (bounciness of ball when hitting ground) is dependent on the subTimeStep.

A smaller subTimeStep seems to cause the ball to be less bouncy (when passing true to new BABYLON.<Ammo/Cannon>JSPlugin(true))

I’ve been trying to look into this: Restitution dependend on timestep - Real-Time Physics Simulation Forum

1 Like

so it might well be a bug on their side ??? if I understand correctly ?

Ah, I’m not familiar with the mathematics behind restitution. Maybe the physics libraries we depend on don’t maintain the same level of bounciness with changing subTimeStep?

For reference, here is a PG where uncommenting one line will change the bounciness of the ball

// Please try commenting and uncommenting the line below
// scene.getPhysicsEngine().setSubTimeStep(1);
1 Like