# Making Havok Joints more rigid?

**URL:** <https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879>\
**Category:** Questions\
**Tags:** physics, havok, joint, constraint\
**Created:** [October 2, 2024, 3:54am UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879 "2024-10-02T03:54:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![regna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/regna/32/23915_2.png) [@regna](https://forum.babylonjs.com/u/regna)\
**Post date:** [October 2, 2024, 3:54am UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/1 "2024-10-02T03:54:00Z")

</div>

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:

[![](https://img.youtube.com/vi/TQ14tUXnjfA/maxresdefault.jpg "Bullet vs PhysX vs Havok Constraint Rigidity") ](https://www.youtube.com/watch?v=TQ14tUXnjfA)

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](https://playground.babylonjs.com/#10X8RU#16)

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

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 2, 2024, 8:15am UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/2 "2024-10-02T08:15:29Z")

</div>

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!).

---

<div class="post-metadata">

**Author:** ![regna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/regna/32/23915_2.png) [@regna](https://forum.babylonjs.com/u/regna)\
**Post date:** [October 2, 2024, 9:20am UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/3 "2024-10-02T09:20:09Z")

</div>

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) .

[![](https://img.youtube.com/vi/X0rwKtxptkE/hqdefault.jpg "Bullet vs PhysX vs Havok Constraint Rigidity - Distance and Prismatic Joints") ](https://www.youtube.com/watch?v=X0rwKtxptkE)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 2, 2024, 9:42am UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/4 "2024-10-02T09:42:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tr909](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tr909/32/44497_2.png) [@Tr909](https://forum.babylonjs.com/u/Tr909)\
**Post date:** [October 2, 2024, 10:05am UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/5 "2024-10-02T10:05:17Z")

</div>

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 -

```auto
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)](https://playground.babylonjs.com/#10X8RU#17)

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

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [October 2, 2024, 12:47pm UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/6 "2024-10-02T12:47:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![regna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/regna/32/23915_2.png) [@regna](https://forum.babylonjs.com/u/regna)\
**Post date:** [October 2, 2024, 4:17pm UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/7 "2024-10-02T16:17:51Z")

</div>

> [@Cedric](#):
>
> Also, in the Physics6DoFLimit, there is `stiffness` and `damping`. Tweaking these values might help.

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.

* * *

> [@Cedric](#):
>
> Did you try to use `setAxisFriction` ?

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

* * *

> [@Tr909](#):
>
> I’ve noticed this effect too - as physics shapes get further away, their constraint limits become less and less rigid.

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

> [@Tr909](#):
>
> If you need the swinging mesh to have accurate collisions, you’d need to do some extra work beyond that too… 😬

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [October 2, 2024, 5:31pm UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/8 "2024-10-02T17:31:37Z")

</div>

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](https://github.com/nitaigao/engine-showcase/blob/master/etc/vendor/havok/Source/Physics/Dynamics/Constraint/hkpConstraintData.h) 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.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [October 2, 2024, 5:35pm UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/9 "2024-10-02T17:35:16Z")

</div>

cc @eoin

---

<div class="post-metadata">

**Author:** ![eoin](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@eoin](https://forum.babylonjs.com/u/eoin)\
**Post date:** [October 3, 2024, 2:38pm UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/10 "2024-10-03T14:38:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![regna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/regna/32/23915_2.png) [@regna](https://forum.babylonjs.com/u/regna)\
**Post date:** [October 3, 2024, 4:05pm UTC](https://forum.babylonjs.com/t/making-havok-joints-more-rigid/53879/11 "2024-10-03T16:05:08Z")

</div>

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