Making Havok Joints more rigid?

Havok joints seem to be less rigid than Bullet and PhysX joints.

In the video below, a 6-DOF joint with all 6 axes locked is created in Havok, PhysX, and Bullet. A capsule player walks into the joint, and I thought that the fully-locked joint would block the player like a static wall. This is true for PhysX and Bullet, however the player is able to bend the Havok joint:

I’ve created a Playground for Havok with a fully-locked 6-DOF joint. After 2 seconds, a constant force is applied to the joint’s child body in the z-direction, which unexpectedly is able to bend the fully-locked joint:

Playground: https://playground.babylonjs.com/#10X8RU#16

Is there a way to make Havok joints more rigid? Thank you all for your help :slight_smile:

1 Like

I don’t know if it’s an option, but if you set the mass to 0, the motion type will be set to STATIC and the child object won’t move. You can also increase the mass, until the child stops moving (but it may not be an option either!).

1 Like

Thank you, @Evgeni_Popov, I’ll look into increasing mass.

In the meantime, I wanted to share a video comparison of Bullet vs. PhysX vs Havok joint rigidity with Distance and Prismatic joints. My worry with increasing mass is that it will take more force to move joints with angular and distance limits.

In the video below, I like Bullet’s behavior where the joints move freely within the angular and linear limits and become very rigid once the limits are reached (without needing to increase mass) .

1 Like

Let cc @Cedric, who knows a lot more about physics than I do!

1 Like

I’ve noticed this effect too - as physics shapes get further away, their constraint limits become less and less rigid.

This will be 100% rigid -

pivotA: new BABYLON.Vector3(0, 0, 0),
pivotB: new BABYLON.Vector3(0, 0, 0),

But as pivotB moves further away, it will become less and less rigid.

The only way I’ve been able to combat this is to make the shapes overlap each other like this -
Havok 6DOF Test | Babylon.js Playground (babylonjs.com)

If you need the swinging mesh to have accurate collisions, you’d need to do some extra work beyond that too… :grimacing:

1 Like

Did you try to use setAxisFriction ?
Also, in the Physics6DoFLimit, there is stiffness and damping. Tweaking these values might help.

1 Like

So far, when I try tweaking stiffness and damping, the joint only becomes softer. In the descriptions of the stiffness and damping functions (in the types .d.ts file), it says:

This will convert the axis from a hard limit to one which uses a spring model, parameterized on stiffness and damping

If the hard limit is already quite flexible, the stiffness and damping spring model seems like it makes it more flexible.


So far, this hasn’t worked for me either, though I can keep looking into this.


Ooh interesting find. I worry a bit about altering the pivots, as you mentioned below. Though, let me look into this more

I have seen referenced (long ago) constraint types of breakable and malleable. Not sure if this is at all applicable here.

Referenced here in 2009 for Havok Physics Dynamics including

[8," CONSTRAINT_TYPE_STIFFSPRING"],[9,“CONSTRAINT_TYPE_WHEEL”],[10,“CONSTRAINT_TYPE_GENERIC”],[11,“CONSTRAINT_TYPE_CONTACT”],[12,“CONSTRAINT_TYPE_BREAKABLE”],[13,“CONSTRAINT_TYPE_MALLEABLE”],[14,“CONSTRAINT_TYPE_POINTTOPLANE”],[15,“CONSTRAINT_TYPE_PULLEY”],

Are we missing any constraint types? I’ve seen other references indicate the support for run-time removal of constraints usable as “breaking” a constraint.

Are we missing any control mechanisms to modify malleability of constraints?

Again, not sure if any of this applies to our current implementation of Havok Physics.

1 Like

cc @eoin

1 Like

I think this might unfortunately be a case of “that’s just the way it is” - the constraint solver is a balance of performance, stiffness and stability. I do wish our fixed angular limits were stiffer in this kind of scenario where the arm of the force is very large, but there isn’t really much we can tweak here. If you want perfectly rigid attachments between objects, the best way to do that is by adding all the components to a compound shape - that will be a perfectly rigid attachment and will execute faster.

@HiGreg, I think this is a little off-topic, but the SDK you’ve linked to is a previous generation of our physics engine, which was distributed for a limited time in an arrangement with Intel many years ago. That SDK is not representative of what’s used in Babylon.

4 Likes

Ah I see, thank you for confirming, @eoin !