A solver for IK with CCD Algorithm.
[name] solves Inverse Kinematics Problem with CCD Algorithm.
[name] is designed to work with [page:SkinnedMesh] loaded by [page:MMDLoader] but also can be used for generic [page:SkinnedMesh].
var ikSolver;
// Load MMD resources and instantiate CCDIKSolver
new THREE.MMDLoader().load(
'models/mmd/miku.pmd',
function ( mesh ) {
ikSolver = new CCDIKSolver( mesh, mesh.geometry.iks );
scene.add( mesh );
}
);
function render() {
animate(); // update bones
if ( ikSolver !== undefined ) ikSolver.update();
renderer.render( scene, camera );
}
[example:webgl_loader_mmd]
[page:SkinnedMesh mesh] — [page:SkinnedMesh] for which [name] solves IK problem.
[page:Array iks] — An array of [page:Object] specifying IK parameter. target, effector, and link-index are index integers in .skeleton.bones.
The bones relation should be "links[ n ], links[ n - 1 ], ..., links[ 0 ], effector" in order from parent to child.
Creates a new [name].
An array of IK parameter passed to the constructor.
[page:SkinnedMesh] passed to the constructor.
Return [page:CCDIKHelper]. You can visualize IK bones by adding the helper to scene.
Update bones quaternion by solving CCD algorithm.
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/animation/CCDIKSolver.js examples/js/animation/CCDIKSolver.js]