Import
CCDIKSolver is an addon, and must be imported explicitly, see Installation#Addons.
import { CCDIKSolver } from 'three/addons/animation/CCDIKSolver.js';
Constructor
new CCDIKSolver( mesh : SkinnedMesh, iks : Array.<CCDIKSolver~IK> )
mesh |
The skinned mesh. |
iks |
The IK objects. |
Properties
.iks : SkinnedMesh
The IK objects.
.mesh : SkinnedMesh
The skinned mesh.
Methods
.createHelper( sphereSize : number ) : CCDIKHelper
Creates a helper for visualizing the CCDIK.
sphereSize |
The sphere size. |
- Returns: The created helper.
.update( globalBlendFactor : number ) : CCDIKSolver
Updates all IK bones by solving the CCD algorithm.
globalBlendFactor |
Blend factor applied if an IK chain doesn't have its own .blendFactor. |
- Returns: A reference to this instance.
.updateOne( ik : CCDIKSolver~IK, overrideBlend : number ) : CCDIKSolver
Updates one IK bone solving the CCD algorithm.
ik |
The IK to update. |
overrideBlend |
If the IK object does not define |
- Returns: A reference to this instance.
Type Definitions
.BoneLink
This type represents bone links.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
index |
number | The index of a linked bone which refers to a bone in the |
||
limitation |
number |
<optional> |
Rotation axis. |
|
rotationMin |
number |
<optional> |
Rotation minimum limit. |
|
rotationMax |
number |
<optional> |
Rotation maximum limit. |
|
enabled |
boolean |
<optional> |
true | Whether the link is enabled or not. |
.IK
This type represents IK configuration objects.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
target |
number | The target bone index which refers to a bone in the |
||
effector |
number | The effector bone index which refers to a bone in the |
||
links |
Array.<CCDIKSolver~BoneLink> | An array of bone links. |
||
iteration |
number |
<optional> |
1 | Iteration number of calculation. Smaller is faster but less precise. |
minAngle |
number |
<optional> |
Minimum rotation angle in a step in radians. |
|
maxAngle |
number |
<optional> |
Minimum rotation angle in a step in radians. |
|
blendFactor |
number |
<optional> |
The blend factor. |