Interface
Vec3(1, 0, 0)
Vec3(0, 1, 0)
Vec3(0, 1, 0)
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
null
Make one or more axis free (unconstrained). Provided as an array of numbers. See fixedAxes.
null
Upper limit for axis (meters for position, radians for rotation). Provided as an array with 6 float numbers:
[posX, posY, posZ, rotX, rotY, rotZ]
null
Lower limit for axis. See limitMax.
null
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.
null
Optional spring to use when applying positional and rotational limits.
null
Specifies friction values for each axis (friction force for translation, friction torque for rotation). Provided as an array with 6 float numbers. See limitMax.
null
Optional motor to power the constraint.
null
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.
0
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.
0
First body position in constraint reference frame. Space is determined by space property.
Vec3(0, 0, 0)
Second body position in constraint reference frame. Space is determined by space property.
Vec3(0, 0, 0)
Reference frame that point1
and point2
use. Following constants available:
CONSTRAINT_SPACE_LOCAL
CONSTRAINT_SPACE_WORLD
CONSTRAINT_SPACE_WORLD
The type of swing constraint to use. Following aliases for types available:
CONSTRAINT_SWING_TYPE_CONE
CONSTRAINT_SWING_TYPE_PYRAMID
CONSTRAINT_SWING_TYPE_CONE
Default Value