Documentation / scene / IKChain
Class: IKChain
Defined in: libs/scene/src/animation/ik/ik_chain.ts:12
Represents a chain of joints for IK solving.
Constructors
Constructor
new IKChain(
nodes):IKChain
Defined in: libs/scene/src/animation/ik/ik_chain.ts:25
Create an IK chain from an array of scene nodes.
Parameters
nodes
Array of scene nodes from root to end effector
Returns
IKChain
Accessors
joints
Get Signature
get joints():
IKJoint[]
Defined in: libs/scene/src/animation/ik/ik_chain.ts:100
Get all joints in the chain.
Returns
IKJoint[]
root
Get Signature
get root():
IKJoint
Defined in: libs/scene/src/animation/ik/ik_chain.ts:107
Get the root joint (first joint in the chain).
Returns
endEffector
Get Signature
get endEffector():
IKJoint
Defined in: libs/scene/src/animation/ik/ik_chain.ts:114
Get the end effector (last joint in the chain).
Returns
totalLength
Get Signature
get totalLength():
number
Defined in: libs/scene/src/animation/ik/ik_chain.ts:121
Get the total length of the chain.
Returns
number
length
Get Signature
get length():
number
Defined in: libs/scene/src/animation/ik/ik_chain.ts:128
Get the number of joints in the chain.
Returns
number
constraints
Get Signature
get constraints(): readonly
IKConstraint[]
Defined in: libs/scene/src/animation/ik/ik_chain.ts:195
Get all constraints in the chain.
Returns
readonly IKConstraint[]
Methods
fromNodeHierarchy()
staticfromNodeHierarchy(startNode,endNode):IKChain
Defined in: libs/scene/src/animation/ik/ik_chain.ts:71
Create an IK chain by traversing from a start node to an end node.
Parameters
startNode
The root joint of the chain
endNode
The end effector joint
Returns
IKChain
The created IK chain
Remarks
This method walks up the parent chain from the end node until it reaches the start node, building the joint chain in the process.
updateFromNodes()
updateFromNodes():
void
Defined in: libs/scene/src/animation/ik/ik_chain.ts:135
Update joint positions from their scene nodes.
Returns
void
storeOriginalPositions()
storeOriginalPositions():
void
Defined in: libs/scene/src/animation/ik/ik_chain.ts:144
Store current positions as original positions.
Returns
void
restoreOriginalPositions()
restoreOriginalPositions():
void
Defined in: libs/scene/src/animation/ik/ik_chain.ts:154
Restore joints to their original positions.
Returns
void
addConstraint()
addConstraint(
constraint):void
Defined in: libs/scene/src/animation/ik/ik_chain.ts:166
Add a constraint to a specific joint.
Parameters
constraint
The constraint to add
Returns
void
removeConstraint()
removeConstraint(
constraint):boolean
Defined in: libs/scene/src/animation/ik/ik_chain.ts:176
Remove a constraint from the chain.
Parameters
constraint
The constraint to remove
Returns
boolean
True if the constraint was found and removed
clearConstraints()
clearConstraints():
void
Defined in: libs/scene/src/animation/ik/ik_chain.ts:188
Clear all constraints from the chain.
Returns
void
applyConstraints()
applyConstraints():
void
Defined in: libs/scene/src/animation/ik/ik_chain.ts:202
Apply all constraints to the joint chain.
Returns
void