Havok physics rigidbody don't move when the damping values of several bodies are different

I found this bug quite a while ago but I managed to recreate it in playground today.

The problem is that the some rigidbody stops and does not move at all.

Here are the reproduction conditions of the bug.

  • Must be a scene with a lot of rigid bodies. (About 100?)
  • The Linear Damping values for rigid bodies must all be different.

(Isn’t the bug really nonsense?)

cc @carolhmj

Oh that is strange :open_mouth: Playing with the PG a bit, I could get it to happen for even less bodies (a 4x4 = 16 grid): Physics V2 setLinearDamping problem | Babylon.js Playground (babylonjs.com), and the amount of increase on the linearDamping also seems to interfere: Physics V2 setLinearDamping problem | Babylon.js Playground (babylonjs.com) (increasing by 1E-7 each step made some not move, while increasing by 1E-8 made all move)

@eoin any idea of what’s going on?

1 Like

The engine currently has a limit on the number of unique “motion properties” (which are combinations of linear/angular damping and gravity factor) that are in a world. It should be 60, so not sure what happened that you’re able to reproduce with 16 bodies, and it’s certainly a bug that the bodies stop moving entirely. We could look at removing that limit in a future update, but for now, the only workaround would be to use less unique combinations of those properties.

I’m curious what you need 100 unique linear damping values for, though.

Models in MMD typically have 100 to 500 rigid bodies and joints. (There are many resources on the skirt, especially for female models.)
The parameters of the bodies can all be different or the same I can’t guarantee this because it’s all determined by what data the user puts in.

What I’m doing is just making these available to Babylon.js.

You may feel it’s quite a heavy task, but the implementation already with ammo.js works fine.