Shaking of physical bodies

Hello Everyone!!

In my project, I’m trying to make wires. To do this, I create physical bodies and constraints for nodes connected to the wire skeleton, but from time to time the wire starts to shake. What could be the reason? Also, this happens much less often on the playground than in my project, and it seems that the less the render is loaded, the less the wires shake, but this is just my guess. The latest versions of dependencies are selected in my project
Playground: https://playground.babylonjs.com/#0LCP4Z#5


My proj:

Maybe @Cedric or @eoin can help.

I’ve added the Babylon Debug Physics Viewer to the PG: https://playground.babylonjs.com/#0LCP4Z#6

I’m not yet sure what’s causing the issue, though hopefully this debug view can help

It looks like bodies are created at the same position, for all of them so it takes some time to resolve collisions. try creating bodies as static and check their position correspond to the bone position.

Hi, I’m sorry for the long absence. It looks like I managed to solve the problem, but I’m not quite sure what exactly I did, as I didn’t find enough information in the documentation. When creating HavokPlugin, I set _useDeltaForWorldStep to false (it was previously true). Could you explain to me what this parameter is responsible for? :sweat_smile:

delta = true → frame time is measured and used for delta time
delta = false → frame time is a fixed value

if the frame per second is low, delta time will be high and this will have an influence on the physics.
Setting it to false will make physics computation independent of the framerate.

1 Like

Thanks for the explanation!