Class TwoBoneIKSolver
Two-Bone IK solver that mirrors Unity Animation Rigging behaviour. Solves entirely from first principles each frame — no incremental delta accumulation — so it never drifts or glitches.
Algorithm:
- Compute desired mid-joint position via Law of Cosines.
- Use the hint (pole vector) to define the bend plane.
- RotateRootToward desiredMid, then RotateMidToward target.
- Blend by weight.
public static class TwoBoneIKSolver
- Inheritance
-
TwoBoneIKSolver
- Inherited Members
Methods
Solve(Transform, Transform, Transform, Vector3, Vector3, float)
public static void Solve(Transform root, Transform mid, Transform tip, Vector3 targetPosition, Vector3 hintPosition, float weight = 1)
Parameters
rootTransformmidTransformtipTransformtargetPositionVector3hintPositionVector3weightfloat