struct

TwoBoneIKChain

Description of a three-bone chain that gets solved analytically.

Module
Animation
Header
#include "Animation/IK/TwoBoneIK.h"
Namespace
Mowo

Typical mapping: arm: rootBone = shoulder, midBone = elbow, endBone = wrist leg: rootBone = hip, midBone = knee, endBone = ankle

polePosition is the world-space hint that tells the solver which way the mid joint should face (e.g. for a knee, put the pole in front of the character so it doesn't fold backward). It is applied as a swing about the root→end axis AFTER the chain has been solved onto the target, so it moves the knee without ever moving the foot off its goal. When hasPoleHint is false the solver bends in the chain's current plane — fine for "preserve silhouette" use cases (foot-IK on flat ground), but knee/elbow direction is then determined entirely by the current animated pose.

weight is a 0..1 slerp blend between the pre-IK and post-IK pose; lets gameplay code ease the constraint in and out without popping.

Properties

TypeNameDescription
int32_trootBoneDefault -1.
int32_tmidBoneDefault -1.
int32_tendBoneDefault -1.
Vec3polePositionDefault Vec3(0.0f, 0.0f, 0.0f).
boolhasPoleHintDefault false.
floatweightDefault 1.0f.
boolhasMidLimitRange the MIDDLE joint's interior angle (root-mid-end) is allowed to take, in degrees: 0 is fully folded, 180 dead straight. The pole hint decides which SIDE the joint bends toward; nothing until now decided how FAR, so a target placed behind a knee hyperextended it into a backwards leg and a target on top of the hip folded the shin through the thigh. Off by default — an existing chain solves exactly as it did. When on, the reach is recomputed from the clamped angle, so an out-of-range target is approached as closely as the limit allows (the direction align still points the limb at it) instead of being reached by breaking the joint. Default false.
floatmidMinAngleDegreesDefault 0.0f.
floatmidMaxAngleDegreesDefault 180.0f.
boolallowTwistUE's bAllowTwist, and it only means anything on the target-rotation overload. A target rotation is authored from something that measured a DIRECTION and nothing else — a floor normal says which way is up under the foot, it says nothing about which way the toes point; a grip normal says which way the palm faces. Taking such a rotation whole overwrites the twist about the limb's own axis too, so a foot planted on a slope yaws off the direction the animation was walking in and a hand rolls on its wrist. With twist disallowed only the SWING of the override is applied and the animated twist survives underneath it. Defaults to the historical whole-rotation behaviour so an explicitly authored goal (a hand placed on a ladder rung, where the twist IS the point) keeps solving exactly as it did. Default true.
Generated from Animation/IK/TwoBoneIK.h via animation.json · Oct 26, 2026Version 1.0.0