Interpolation in HAVOK?

When I see the demo at
everything is smooth - especially in Chrome.

However when I see any other - or make any physics in HAVOC - even the official documentation, I see physics objects that are not interpolated in the render:

It creates jerky movement when rigidbodies moves fast.

Forces | Babylon.js Documentation → when the elements fly fast out of the screen they jitter, specially in Firefox.

Having worked many years with various engines, my eyes tells me that “hey, these rigidbodies are not set to interpolate”… Hints to interpolate, anyone? Thanks :slight_smile:

1 Like

cc @carolhmj and @Cedric

There is no interpolation with physics.
I tried to repro the jitter in FF but I didn’t see anything particular.
Can you record this jitter?
In the PG, the size of the world and forces are set to show the PhysicsHelper. In the demo, they are set for fast action in a small world. So, in the PG, it may look like action is happening on the moon, not in the demo.

1 Like

I’m sorry for answering late, but this keeps popping up.

Physics runs at it’s own speed, frames runs at their own speed. Frames are not steady, physics tick is.

That’s why you need interpolation: if you just show what the physics engine spit out on every frame, you get jerky motion.

What good is 100’s of FPS, if for example 3 frames shows the same position, then the next frame there’s movement? This is why one needs interpolation, and that’s how it is done in all modern game engines. (before the extra step of motion blur)

If you have a setup of 2 monitors to ensure your computer has something to do, then run this:

you will notice that the ball is not dropping silky smooth, despite possibly hundreds of FPS.

Yes, I can, and have recorded it, but the argument would just be “that’s because of the video capture” as it will often get extremely jerky on capture due to even more FPS variants injected…

It’s really not a matter of showing but knowing that Physics need to be inter- or extrapolated (or extremely over sampled which is a poor solution) to be represented smoothly. And Babylon.js w Havok has no way of doing this?

Correct me if I’m wrong @Evgeni_Popov and @sebavan but I think physics update is done for every rendered frame. So, if the physics update is using fixed delta time then physics will appear to run faster on fast refresh screens. If it’s using delta time update, then there is no limit in physics update.

Yes, the Scene.animate method is called each time Scene.render is called, and this is the method responsible to advance the animations / the physics engine:

My mind is glowing :smiley:

I’m still new to Babylon, am more an artist than programmer, and I still cannot get the smooth physics animations / across varying FPS that I can get in other engines using out of the box “Interpolate” functions on rigidbodies.

Are you guys saying that I’m wrong or that’s how it is, or trying to tell me something I don’t get on how to achieve smooth physics in Babylon?