Class SixDOFConstraintSettingsInterface

Hierarchy (view full)

Properties

axisX1: any

Default Value

Vec3(1, 0, 0)
axisX2: any

Default Value

Vec3(1, 0, 0)
axisY1: any

Default Value

Vec3(0, 1, 0)
axisY2: any

Default Value

Vec3(0, 1, 0)
fixedAxes: null | number[]

Make one or more axis fixed (fixed at value 0). Provided as an array of numbers.

Example

// 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

Default Value

null
freeAxes: null | number[]

Make one or more axis free (unconstrained). Provided as an array of numbers. See fixedAxes.

Default Value

null
limitMax: null | number[]

Upper limit for axis (meters for position, radians for rotation). Provided as an array with 6 float numbers:

[posX, posY, posZ, rotX, rotY, rotZ]

Default Value

null
limitMin: null | number[]

Lower limit for axis. See limitMax.

Default Value

null
limitedAxes: null | number[]

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 number
  • minN - lower constraint limit
  • maxN - upper constraint limit

Example

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

Default Value

null
limitsSpringSettings: SpringSettings

Optional spring to use when applying positional and rotational limits.

Default Value

null
maxFriction: null | number[]

Specifies friction values for each axis (friction force for translation, friction torque for rotation). Provided as an array with 6 float numbers. See limitMax.

Default Value

null
motorSettings: MotorSettings

Optional motor to power the constraint.

Default Value

null
numPositionStepsOverride: number

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.

Default Value

0
numVelocityStepsOverride: number

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.

Default Value

0
point1: any

First body position in constraint reference frame. Space is determined by space property.

Default Value

Vec3(0, 0, 0)
point2: any

Second body position in constraint reference frame. Space is determined by space property.

Default Value

Vec3(0, 0, 0)
space: number

Reference frame that point1 and point2 use. Following constants available:

CONSTRAINT_SPACE_LOCAL
CONSTRAINT_SPACE_WORLD

Default Value

CONSTRAINT_SPACE_WORLD
swingType: number

The type of swing constraint to use. Following aliases for types available:

CONSTRAINT_SWING_TYPE_CONE
CONSTRAINT_SWING_TYPE_PYRAMID

Default Value

CONSTRAINT_SWING_TYPE_CONE