struct
IKGoal
A single IK constraint on a three-bone chain.
- Module
- Game
- Header
#include "Game/Components/IKComponent.h"- Namespace
Mowo
Lifetime model: - Author at edit time: chain bone indices + pole hint. These typically point at a character's left arm, right arm, left leg, right leg. - Drive at runtime: targetPosition (and optionally targetRotation) is pushed each frame by gameplay code or the foot-IK pass — the AnimationSystem applies the solve before computing global transforms.
One IKComponent owns N goals; the typical biped uses 2-4 (hands + feet).
Properties
| Type | Name | Description |
|---|---|---|
std::string | name | editor label, e.g. "LeftFoot" |
TwoBoneIKChain | chain | root/mid/end + pole + weight |
Vec3 | targetPosition | Default Vec3(0.0f, 0.0f, 0.0f). |
Quat | targetRotation | Default Quat::Identity(). |
bool | hasTargetRotation | false => end bone follows chain freely Default false. |
bool | enabled | Default true. |
bool | autoFootRaycast | Auto foot-IK (system-driven by raycast each frame) When autoFootRaycast is true the AnimationSystem performs a downward raycast from the end bone's current world position before running the solver. On hit: targetPosition is updated to hit.point + hit.normal * groundOffset, and (if alignToNormal) targetRotation is rebuilt to align the foot's up-axis to the surface normal. On miss: the goal weight is zeroed for this frame so the limb falls back to the animated pose smoothly. Targets remain in *world space* for these goals; the IK pass converts to skeleton-local before solving. Default false. |
float | raycastUp | ray start: bone world pos + up*raycastUp Default 0.3f. |
float | raycastDistance | max ray length from start downward Default 1.0f. |
float | groundOffset | foot height above hit point Default 0.0f. |
bool | alignToNormal | overrides targetRotation each tick Default true. |
uint32_t | raycastLayerMask | Player (layer 2) is cleared, matching CameraControllerComponent. The ray starts raycastUp above the ankle, which is inside the character's own capsule — and a character now carries a real body in the collision world, so an all-layers mask planted every foot on the capsule's bottom cap instead of the floor. Default 0xFFFFFFFBu. |
float | footIkAuthoredWeight | Runtime weight state for auto foot-IK. The authored chain weight is captured once so a raycast miss can ease the runtime weight to zero and a later hit can ease it back to the AUTHORED value — the old code wrote a hard 0/1, destroying the authored weight and popping on transitions. Default 0.0f. |
bool | footIkAuthoredCaptured | Default false. |
bool | lockPlantedFoot | Foot locking (UE foot placement's plant lock). While the animated foot moves slower than plantSpeed (m/s, world) it is planted: the IK target stays on the spot where it planted, so turning on the spot or a speed mismatch between clip and movement no longer slides the foot. The lock lets go once the animated foot drifts unlockDistance (m) away or lifts off, and the target eases from the locked spot to the live one over unlockBlendTime seconds. Default false. |
float | plantSpeed | Default 0.3f. |
float | unlockDistance | Default 0.25f. |
float | unlockBlendTime | Default 0.15f. |
bool | footLocked | Runtime lock state. Default false. |
Vec3 | footLockPosition | Default Vec3(0.0f, 0.0f, 0.0f). |
Vec3 | footLockPrevious | Default Vec3(0.0f, 0.0f, 0.0f). |
bool | footLockHasPrevious | Default false. |
float | footUnlockBlend | Default 0.0f. |
Generated from Game/Components/IKComponent.h via game.json · Nov 5, 2026Version 1.0.0