A frame representing a kinematic joint with any combination of degrees of freedom. Each degree of freedom is an offset applied on top of the frame transform. Only links may be added as children and a joint may only have a single child.
On this page
- Properties
- child
- isClosure
- rotationDoFCount
- translationDoFCount
- dof
- dofFlags
- dofValues
- dofTarget
- dofRestPose
- minDoFLimit
- maxDoFLimit
- targetSet
- restPoseSet
- matrixDoF
- Methods
- clearDoF
- setDoF
- setDoFValues
- setDoFValue
- getDoFValue
- getDoFQuaternion
- getDoFEuler
- getDoFPosition
- setRestPoseValues
- setRestPoseValue
- getRestPoseValue
- getRestPoseQuaternion
- getRestPoseEuler
- getRestPosePosition
- setTargetValues
- setTargetValue
- getTargetValue
- getTargetQuaternion
- getTargetEuler
- getTargetPosition
- setMinLimits
- setMinLimit
- getMinLimit
- setMaxLimits
- setMaxLimit
- getMaxLimit
- setMatrixDoFNeedsUpdate
- makeClosure
- addChild
- Inherited
Properties
The child link of the joint, whether added directly or through makeClosure.
Whether the child relationship is a closure made with makeClosure.
Number of rotation degrees of freedom set on the joint.
Number of translation degrees of freedom set on the joint.
The degrees of freedom set on the joint in DOF order.
Flags indexed by DOF value that are 1 when the degree of freedom is set.
Current values of each degree of freedom indexed by DOF value. If modified directly
setMatrixDoFNeedsUpdate must be called.
Target value of each degree of freedom indexed by DOF value. The solver moves the
joint toward these when targetSet is true.
Rest pose of each degree of freedom indexed by DOF value. The solver moves the joint
toward these when restPoseSet is true and it does not compromise the other goals.
Minimum limit of each degree of freedom indexed by DOF value.
Maximum limit of each degree of freedom indexed by DOF value.
targetSet: boolean = false
Whether the solver should move the joint toward dofTarget.
restPoseSet: boolean = false
Whether the solver should move the joint toward dofRestPose.
Transform offset produced by the current degree of freedom values.
Methods
clearDoF(): voidRemoves all degrees of freedom from the joint.
setDoF(
// The `DOF` fields to set.
...dof: number
): voidSets the degrees of freedom of the joint and resets all related values and limits.
Arguments must be in X, Y, Z, EX, EY, EZ order without duplicates.
setDoFValues(
// One value per degree of freedom.
...values: number
): voidSets the value of every degree of freedom in dof order, clamped to the joint limits.
setDoFValue(
// The `DOF` field to set.
dof: number,
value: number
): booleanSets the value of a degree of freedom, clamped to the joint limits.
getDoFValue(
// The `DOF` field to get.
dof: number
): numberReturns the value of a degree of freedom.
getDoFQuaternion( target: Array<number> | Float32Array ): voidWrites the rotation degree of freedom values as a quaternion into target.
getDoFEuler( target: Array<number> | Float32Array ): voidWrites the rotation degree of freedom values as Euler angles into target.
getDoFPosition( target: Array<number> | Float32Array ): voidWrites the translation degree of freedom values into target.
setRestPoseValues(
// One value per degree of freedom.
...values: number
): voidSets the rest pose of every degree of freedom in dof order, clamped to the joint limits.
setRestPoseValue(
// The `DOF` field to set.
dof: number,
value: number
): booleanSets the rest pose of a degree of freedom, clamped to the joint limits.
getRestPoseValue(
// The `DOF` field to get.
dof: number
): numberReturns the rest pose of a degree of freedom.
getRestPoseQuaternion( target: Array<number> | Float32Array ): voidWrites the rotation rest pose as a quaternion into target.
getRestPoseEuler( target: Array<number> | Float32Array ): voidWrites the rotation rest pose as Euler angles into target.
getRestPosePosition( target: Array<number> | Float32Array ): voidWrites the translation rest pose into target.
setTargetValues(
// One value per degree of freedom.
...values: number
): voidSets the target of every degree of freedom in dof order, clamped to the joint limits.
setTargetValue(
// The `DOF` field to set.
dof: number,
value: number
): voidSets the target of a degree of freedom, clamped to the joint limits.
getTargetValue(
// The `DOF` field to get.
dof: number
): numberReturns the target of a degree of freedom.
getTargetQuaternion( target: Array<number> | Float32Array ): voidWrites the rotation target as a quaternion into target.
getTargetEuler( target: Array<number> | Float32Array ): voidWrites the rotation target as Euler angles into target.
getTargetPosition( target: Array<number> | Float32Array ): voidWrites the translation target into target.
setMinLimits(
// One value per degree of freedom.
...values: number
): voidSets the minimum limit of every degree of freedom in dof order.
setMinLimit(
// The `DOF` field to set.
dof: number,
value: number
): voidSets the minimum limit of a degree of freedom and clamps the current value to it.
getMinLimit(
// The `DOF` field to get.
dof: number
): numberReturns the minimum limit of a degree of freedom.
setMaxLimits(
// One value per degree of freedom.
...values: number
): voidSets the maximum limit of every degree of freedom in dof order.
setMaxLimit(
// The `DOF` field to set.
dof: number,
value: number
): voidSets the maximum limit of a degree of freedom and clamps the current value to it.
getMaxLimit(
// The `DOF` field to get.
dof: number
): numberReturns the maximum limit of a degree of freedom.
setMatrixDoFNeedsUpdate(): voidFlags the joint as needing its degree of freedom matrix and world matrix updated.
makeClosure( child: Link ): voidConnects the given link to this joint as a closure. The link is not added to children
and keeps its own parent, but is set as child and the joint is appended to the link's
closureJoints. The solver constrains all six axes between the joint and the link to
keep the closure closed.
addChild( child: Link ): voidAdds a link as the child of this joint. Throws if the child is not a link or the joint already has a child.