Different behaviour of Physics Constraint limit when upgrading from 6.2 to 6.6

Hi everyone,

I have just upgraded from version 6.2 to 6.6. I double checked the changelog and could not find any breaking changes.

Please have a look here: https://playground.babylonjs.com/#YQHYKD#2 (you’ll see)

Some details:

  • In 6.2 everything ok.

  • In the above playground it is just the upper arm that freaks out - if I set the minLimit and maxLimit of the constraint to zero (Line 58).

  • However, notice that even when I set the minLimit/maxLimit != 0, the arm keeps rotating forever. See bool on Line 29. This seems strange as well.

I am unsure how to proceed now. Is my config faulty which went through in earlier versions? Or did something break inbetween versions or so?

Best wishes
Joe

P.S. Not sure if required, but here is the full model: Babylon.js Playground

I have no idea how the playground manages this. But Havok did get a bump from 1.0.0 to 1.0.1 during the first month of V6 so no idea if that may of caused it?

1 Like

Huh! So I was trying to find the Havok changelog. Found this instead: Fix bug where constraint perp axes were ignored by eoineoineoin · Pull Request #13859 · BabylonJS/Babylon.js · GitHub

Going back to the playground, if I change the perpAxes of the leftUpperArmPhy.body to BABYLON.Vector3(0, 1, 0) and ensure that the goNuts variable is false, it seems to work.

Ok, going further back to the full model, it seems if you mess with the wrong perpAxis you can more reliably make the meshes explode.

No idea if the physics engine is supposed to explode if you choose a wrong axis :dizzy_face:

P.S. Full model with adapted perpAxes: https://playground.babylonjs.com/#J8FG9I#1 (working)

cc @eoin to take a look when possible

Hey, so this is definitely something we could clean up; the issue is that you only specified a ‘perpAxisA’/‘perpAxisB’, which just happened to be the default value used for ‘axisA’/‘axisB’, (Babylon.js/havokPlugin.ts at master · BabylonJS/Babylon.js · GitHub) which, in turn caused a singularity in the solver.

If you specify both the axis and perp axis, it’ll fix the jittering (but not sure if these are the real values you want to use):