Simulation of Physics animation - slower

Hi, is there a way, how to slow down the trajectory of physics simulation? I mean something like a slow motion shot during a sports matches. I need the animation / motion simulation to be done more slowly, adjustable to some percentage. The trajectory of movement must be the same, unchanged - of course. Thank you.

Hi JM. https://www.babylonjs-playground.com/#DU4FPJ#130

Line 9… change the 90 to other values (I think 60 is default). Simple adjustment.

BUT… possible issues! Set to 120… and re-run. Notice…

  • After bounce #1: Rebound has good energy
  • After bounce #2: Rebound energy weak
  • After bounce #3: Rebound has good energy
  • After bounce #4: Rebound energy weak
  • After bounce #5: Rebound has good energy
  • After bounce #6: Rebound energy weak
    etc. (rebound == restitution, for the most-part)

SO… hmm.
You might LOSE “same trajectory” feature… when adjusting speeds in this way.

Now re-test, using line 5 OimoJSPlugin and/or CannonJSPlugin (two other physics engines that BabylonJS interfaces-with). Cannon acts about the same as Ammo, but Oimo seems the best at THIS. (exponential damping?) (good rubber for good ball bounces) :slight_smile:

Problem is, Oimo Physics Engine never lets the sphere stop bouncing. It needs restitution settings in the .84 or less ranges… to make sphere eventually enter sleeping state.

Demo PG of such: #131 Oimo engine, grd and sphere restitution = .84. Blue rectangle quits spinning when sphere physicsBODY goes .sleeping == true. Works good… but change restitutions to .85 or higher… and sphere never goes to sleep.

Ok, that’s all I have, except for deterministic-lockstep. which is a ‘special thing’ that applies to animations and physics engines. It might not apply to your needs.

Way too much info, huh? I hear ya. :slight_smile:

2 Likes

Thanks for share of info…It looks replay of sport actions is not easy supported. The explained solution, unfortunately, has a problem in that the trajectory of movement changes, like you wrote. I have to test a lot again if this will be a sufficient solution in my case (I use Ammo).