Joints constrain the way two physics bodies move relative to one another. A typical use for a joint would be to
model a door hinge or a robotic arm.
Every joint requires a
Joint
Entity Component
Joint joint
Base component of all the other joint components (revolute_joint, etc.). By itself it will lock the orientations and distances of the constrainer and constrainee.
Schema
breakForce
Float
Default: 10
breakTorque
Float
Default: 10
constrainee
Entity Reference
{linkage,originalEUID,}
constrainer
Entity Reference
{linkage,originalEUID,}
enableCollision
Boolean
Default: false
component.
Joint component
This component specifies the base attributes needed to create a joint, such as the two physics bodies constrained by the joint: the constrainer and the constrainee entity.
The joint constrains the constrainer and constrainee's position and rotation to be dependent on one another. Further information on the specifics of the constraints in the sections below.
A joint can be broken. You can specify the maximum breaking force and torque with breakForce and breakTorque.
You can also enable or disable collision between the constrainer and the constrainee using enableCollision.
Although it depends on the use case, disabling collision is usually preferred and leads to more stable results.
To further customize the constraints of individual degrees of freedom, you can add the
Constraint
Entity Component
Constraint constraint
A physics constraint that can be configured along 6 degrees of freedom. In its default state it behaves as a fixed constraint - that is, it rigidly fixes the constraint frames of its two entities. However, individual degrees of freedom may be unlocked to permit any combination of rotation around the x-, y- and z- axes, and translation along these axes.
Schema
motionLimitSpringDamping
Vector3
Default: [0,0,0]
motionLimitSpringStiffness
Vector3
Default: [0,0,0]
motionLowerLimit
Vector3
Default: [0,0,0]
motionUpperLimit
Vector3
Default: [0,0,0]
swingLimitAngle
Vector2
Default: [0,0]
swingSpringDamping
Float
Default: 0
swingSpringStiffness
Float
Default: 0
twistLimitAngle
Vector2
Default: [0,0]
twistSpringDamping
Float
Default: 0
twistSpringStiffness
Float
Default: 0
unlockedMotion
Unsigned Integer
Default: 0
[1] Along X [2] Along Y [4] Along Z [8] Around X [16] Around Y [32] Around Z
The simplest joint that can be created is a fixed joint.
If you simply attach a
Joint
Entity Component
Joint joint
Base component of all the other joint components (revolute_joint, etc.). By itself it will lock the orientations and distances of the constrainer and constrainee.
Schema
breakForce
Float
Default: 10
breakTorque
Float
Default: 10
constrainee
Entity Reference
{linkage,originalEUID,}
constrainer
Entity Reference
{linkage,originalEUID,}
enableCollision
Boolean
Default: false
WITHOUT a
Constraint
Entity Component
Constraint constraint
A physics constraint that can be configured along 6 degrees of freedom. In its default state it behaves as a fixed constraint - that is, it rigidly fixes the constraint frames of its two entities. However, individual degrees of freedom may be unlocked to permit any combination of rotation around the x-, y- and z- axes, and translation along these axes.
Schema
motionLimitSpringDamping
Vector3
Default: [0,0,0]
motionLimitSpringStiffness
Vector3
Default: [0,0,0]
motionLowerLimit
Vector3
Default: [0,0,0]
motionUpperLimit
Vector3
Default: [0,0,0]
swingLimitAngle
Vector2
Default: [0,0]
swingSpringDamping
Float
Default: 0
swingSpringStiffness
Float
Default: 0
twistLimitAngle
Vector2
Default: [0,0]
twistSpringDamping
Float
Default: 0
twistSpringStiffness
Float
Default: 0
unlockedMotion
Unsigned Integer
Default: 0
[1] Along X [2] Along Y [4] Along Z [8] Around X [16] Around Y [32] Around Z
, a fixed joint will be created.
A fixed joint restricts the constrainee's movement to be dependent on the constrainer. It locks the orientations and relative position of the two physics bodies.
This is somewhat similar to parenting but is implemented through physics rather than the scene graph hierarchy. You should use fixed joints to lock the movement of two physics bodies that you then want to easily break apart from each other, or to connect two physics bodies’ movement without parenting.
Base component of all the other joint components (revolute_joint, etc.). By itself it will lock the orientations and distances of the constrainer and constrainee.
Schema
breakForce
Float
Default: 10
breakTorque
Float
Default: 10
constrainee
Entity Reference
{linkage,originalEUID,}
constrainer
Entity Reference
{linkage,originalEUID,}
enableCollision
Boolean
Default: false
AND a
Constraint
Entity Component
Constraint constraint
A physics constraint that can be configured along 6 degrees of freedom. In its default state it behaves as a fixed constraint - that is, it rigidly fixes the constraint frames of its two entities. However, individual degrees of freedom may be unlocked to permit any combination of rotation around the x-, y- and z- axes, and translation along these axes.
Schema
motionLimitSpringDamping
Vector3
Default: [0,0,0]
motionLimitSpringStiffness
Vector3
Default: [0,0,0]
motionLowerLimit
Vector3
Default: [0,0,0]
motionUpperLimit
Vector3
Default: [0,0,0]
swingLimitAngle
Vector2
Default: [0,0]
swingSpringDamping
Float
Default: 0
swingSpringStiffness
Float
Default: 0
twistLimitAngle
Vector2
Default: [0,0]
twistSpringDamping
Float
Default: 0
twistSpringStiffness
Float
Default: 0
unlockedMotion
Unsigned Integer
Default: 0
[1] Along X [2] Along Y [4] Along Z [8] Around X [16] Around Y [32] Around Z
to an entity, a joint will be created with constraints that are configurable according to what was set in the
Constraint
Entity Component
Constraint constraint
A physics constraint that can be configured along 6 degrees of freedom. In its default state it behaves as a fixed constraint - that is, it rigidly fixes the constraint frames of its two entities. However, individual degrees of freedom may be unlocked to permit any combination of rotation around the x-, y- and z- axes, and translation along these axes.
Schema
motionLimitSpringDamping
Vector3
Default: [0,0,0]
motionLimitSpringStiffness
Vector3
Default: [0,0,0]
motionLowerLimit
Vector3
Default: [0,0,0]
motionUpperLimit
Vector3
Default: [0,0,0]
swingLimitAngle
Vector2
Default: [0,0]
swingSpringDamping
Float
Default: 0
swingSpringStiffness
Float
Default: 0
twistLimitAngle
Vector2
Default: [0,0]
twistSpringDamping
Float
Default: 0
twistSpringStiffness
Float
Default: 0
unlockedMotion
Unsigned Integer
Default: 0
[1] Along X [2] Along Y [4] Along Z [8] Around X [16] Around Y [32] Around Z
component.
Constraint component
The constraint component gives you granular control over each degree of freedom (movement along X,Y,Z and rotation around X,Y,Z). You can:
lock specific axes (no movement or rotation allowed)
free axes for unrestricted movement or rotation
limit movement or rotation within specified ranges
Use unlockedMotion to lock/unlock the degrees of freedom.
References to twist in the attributes (e.g. twistLimitAngle) refers to rotation around the X axis. Swing (e.g. swingLimitAngle) refers to rotation around the Y axis and the Z axis.
Constraint
constraint
A physics constraint that can be configured along 6 degrees of freedom. In its default state it behaves as a fixed constraint - that is, it rigidly fixes the constraint frames of its two entities. However, individual degrees of freedom may be unlocked to permit any combination of rotation around the x-, y- and z- axes, and translation along these axes.
motionLimitSpringDamping
Vector3
Default: [0,0,0]
motionLimitSpringStiffness
Vector3
Default: [0,0,0]
motionLowerLimit
Vector3
Default: [0,0,0]
motionUpperLimit
Vector3
Default: [0,0,0]
swingLimitAngle
Vector2
Default: [0,0]
swingSpringDamping
Float
Default: 0
swingSpringStiffness
Float
Default: 0
twistLimitAngle
Vector2
Default: [0,0]
twistSpringDamping
Float
Default: 0
twistSpringStiffness
Float
Default: 0
unlockedMotion
Unsigned Integer
Default: 0
[1] Along X [2] Along Y [4] Along Z [8] Around X [16] Around Y [32] Around Z