Skip to main content

Module ik

Module ik 

Source
Expand description

Inverse Kinematics solvers.

Provides three complementary IK algorithms:

  • FABRIK (Forward And Backward Reaching IK) – iterative, handles multi-bone chains with constraints, converges fast in ~10 iterations.
  • CCD (Cyclic Coordinate Descent) – rotational approach, each joint rotates to minimize end-effector error.
  • Analytical 2-bone – closed-form solution for shoulder/elbow/wrist style rigs, exact, instantaneous, with elbow pole vector control.

§Quick Start

use proof_engine::animation::ik::{IkChain, FabrikSolver};
use glam::Vec3;

let mut chain = IkChain::new(vec![
    Vec3::new(0.0, 0.0, 0.0),
    Vec3::new(0.0, 1.0, 0.0),
    Vec3::new(0.0, 2.0, 0.0),
]);
FabrikSolver::solve(&mut chain, Vec3::new(1.5, 1.5, 0.0), 10);

Structs§

CcdSolver
CCD: Cyclic Coordinate Descent IK.
FabrikSolver
FABRIK: Forward And Backward Reaching IK.
IkChain
A chain of joints that IK solvers operate on.
IkChain2D
2D IK chain for flat simulations (Vec2 joints).
IkJoint
A single joint in an IK chain.
IkRig
A full character IK rig with multiple named chains.
LookAtSolver
Rotates a joint to aim at a target (look-at constraint).
TwoBoneResult
Result of a 2-bone IK solve.
TwoBoneSolver
Closed-form IK for a 2-bone chain (3 joints: shoulder, elbow, wrist/hand).