Interface
Make one or more axis fixed (fixed at value 0). Provided as an array of numbers.
// Prevent translating along X axis and rotating around Y axis
[CONSTRAINT_SIX_DOF_TRANSLATION_X, CONSTRAINT_SIX_DOF_ROTATION_Y]
Following axis constants available can be used:
CONSTRAINT_SIX_DOF_TRANSLATION_X
CONSTRAINT_SIX_DOF_TRANSLATION_Y
CONSTRAINT_SIX_DOF_TRANSLATION_Z
CONSTRAINT_SIX_DOF_ROTATION_X
CONSTRAINT_SIX_DOF_ROTATION_Y
CONSTRAINT_SIX_DOF_ROTATION_Z
Make one or more axis free (unconstrained). Provided as an array of numbers. See fixedAxes.
Set limits to one or more axis. Provided as an array of non-interleaved values of axis and limits (meters for position, radians for rotation).
[a1, min1, max1, a2, min2, max2, ..., aN, minN, maxN]
where:
aN
- axis alias numberminN
- lower constraint limitmaxN
- upper constraint limit// Allow 0.2m movement on X axis and 10 degrees around Y
[
CONSTRAINT_SIX_DOF_TRANSLATION_X, -0.1, 0.1,
CONSTRAINT_SIX_DOF_ROTATION_Y, -5*rads, 5*rads,
]
See available aliases in fixedAxes.
Upper limit for axis (meters for position, radians for rotation). Provided as an array with 6 float numbers:
[posX, posY, posZ, rotX, rotY, rotZ]
Lower limit for axis. See limitMax.
Optional spring to use when applying positional and rotational limits.
Specifies friction values for each axis (friction force for translation, friction torque for rotation). Provided as an array with 6 float numbers. See limitMax.
Optional motor to power the constraint.
Override for the number of solver position iterations to run. If set to 0
, the constraint
will use global default set by Physics initialization setting
JoltInitSettings.numPositionSteps.
Override for the number of solver velocity iterations to run. If set to 0
, the constraint
will use global default set by Physics initialization setting
JoltInitSettings.numVelocitySteps.
First body position in constraint reference frame. Space is determined by space property.
Second body position in constraint reference frame. Space is determined by space property.
Reference frame that point1
and point2
use. Following constants available:
CONSTRAINT_SPACE_LOCAL
CONSTRAINT_SPACE_WORLD
The type of swing constraint to use. Following aliases for types available:
CONSTRAINT_SWING_TYPE_CONE
CONSTRAINT_SWING_TYPE_PYRAMID