I’m trying to wrap my head around Physics Constraints. I hope this starts a discussion we all can learn from. I think there are 20 possible constraint types, including LOCK and 6DOF. This boils down to 18 interesting ones. BABYLON/Havok only names 5 of these 18. The following table shows all possible combinations of locked degrees of freedom. From two other sources, documentation from COMSOL, and a 2005 academic paper. COMSOL has some nice pictures and pretty detailed explanations linked from their page.

The left column “DIDACTIC” is the name given by the paper, the second column is BABYLON/Havok’s name, and (in lowercase) the name from COMSOL. Duplicatecor alternate COMSOL names are not shown.

(Image from “DETC2005-84109 ON THE COMPUTATION OF DEGREES-OF-FREEDOM : A DIDACTIC PERSPECTIVE” by E. Pennestrì, M. Cavacece, L. Vita, Published 2005.

Interestingly, there are two different names/implementations of 2 angular degrees of freedom in the paper: slotted spheric and toric. What’s the difference in these?

I’m trying to create a playground to help my understanding. In the meantime, there’s these two:

Wow, there are so many joint types I didn’t know about Thank you for the detailed list!

A small addition: For spheric/ball-and-socket joints, there are twist (e.g. X) and swing (Y and Z) angles. If you want limits for the 2 swing angles, the limits can have a cone or pyramid shape.

Interesting. I left out definitions of limits because I wanted to focus on joint attachments only. Are any of these joints fundamentally altered by limits?

I think Havok only natively implements pyramid-shaped, right? Calculated interdependent limits would be interesting. Or maybe distance from a line in addition to distance from a point.

Hmmm. Maybe could combine phantom objects and distance joints to construct different limit “types.”

Edit 3: Here’s the best demo: tap to impart force. All combinations shown:

Here are my previous attempts:
/end Edit3.

Tool to play with any combination of LOCKED Axes is now in the playground. Change one line of code (line 99) to enable/disable axis locks. Tap the screen to impart a random force on the yellow box.

Edit: here’s a full array of all constraint “types”. I’m having trouble with setting a joint’s limits after creation, so there are no linear limits here. Touch the screen to impart a force.

I’m not totally sure this is useful, yet. But it does demonstrate how to change an axisMode between LOCK and FREE after constraint creation.

Edit 2: Here’s a better one where the initial offset of the yellow box is diagonal. It shows how locking a particular linear axis aligns those axes between parent and child (i.e. aligning the defined axis’, perps, or normals of both bodies).