[name]

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

Code Example

let ikSolver; // Load MMD resources and instantiate CCDIKSolver new 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 ); }

Examples

[example:webgl_loader_mmd]
[example:webgl_loader_mmd_pose]
[example:webgl_loader_mmd_audio]

Constructor

[name]( [param:SkinnedMesh mesh], [param:Array iks] )

[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].

Properties

[property:Array iks]

An array of IK parameter passed to the constructor.

[property:SkinnedMesh mesh]

[page:SkinnedMesh] passed to the constructor.

Methods

[method:CCDIKHelper createHelper]()

Return [page:CCDIKHelper]. You can visualize IK bones by adding the helper to scene.

[method:this update]()

Update IK bones quaternion by solving CCD algorithm.

[method:this updateOne]( [param:Object ikParam] )

Update an IK bone quaternion by solving CCD algorithm.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/animation/CCDIKSolver.js examples/jsm/animation/CCDIKSolver.js]