Specialized, high-performance IK solver for exactly 2-bone chains like arms and legs.
Uses analytical geometry instead of iterative solving, making it faster and more predictable
than FABRIK or CCD for this specific use case.
When to use TwoBoneIK:
Human/creature arms (shoulder → elbow → wrist)
Human/creature legs (hip → knee → foot)
Any exactly 2-joint system
When you need guaranteed single-frame solution
When performance is critical
Features:
Analytical solution (no iterations needed)
Pole target for controlling elbow/knee direction
Handles out-of-reach targets gracefully
Deterministic - same input always gives same output
Example
// Character arm reaching for object constsolver = newTwoBoneIKSolver();
// Low-level API for custom control constresult = solver.solve( shoulderPos, elbowPos, // Current position (ignored, recalculated) wristPos, // Current position (ignored, recalculated) targetPos, polePos, 0.3, // Upper arm length 0.25// Forearm length );
// Manually apply result elbow.position.copy(result.midPosition); wrist.position.copy(result.endPosition); shoulder.quaternion.copy(result.upperRotation); elbow.quaternion.copy(result.lowerRotation);
Two-Bone IK Solver (Analytical Solution).
Specialized, high-performance IK solver for exactly 2-bone chains like arms and legs. Uses analytical geometry instead of iterative solving, making it faster and more predictable than FABRIK or CCD for this specific use case.
When to use TwoBoneIK:
Features:
Example
Example
Example