Physics Timestep Clarification

Does the scene.getPhysicsEngine().setTimeStep method determine the amount of time between each physics update, or the amount of simulation time processed each time the physics engine is called by the scene?

All my problems are solved if its the first case. If the latter, wouldn’t I run into standardization issues in my game if my scene is rendering at 60 fps versus 30 fps on another computer? The physics engine would be called at a different rate but still processes the simulation by the same interval. To solve this problem, would it not be better to call the physics engine manually?

I’m using Oimo JS

I think that’s what this dude was working on, but I dont know if it ever got merged.

It was: Animations - Babylon.js Documentation

I think this is exactly what I wanted, thanks!

On a side note, what is the correct way to go about implementing this in the null engine? It works serverside when I create a camera and call scene.render(), but I find calling those methods weird and redundant in the null engine since the engine works fine without them being called and since visuals have no effect server side.

I’ve never messed with the null engine, but am getting to the point where I am going to need to. So im interested in your last question as well!

Second case if you use Oimo, first if you use cannon:

Oimo has a fixed timestamp - Oimo.js/World.js at gh-pages · lo-th/Oimo.js · GitHub , which is set when you call setTimeStep. Technically you could change the timestep every frame by calling set timestep with the right delta. I am not sure how Oimo will react to this… Should probably work.