class

PhysicalAnimationSystem

Drives a bone chain with motor-powered physics blended onto the animated pose, so hit reactions knock a limb off the animation and then recover.

Module
Physics
Header
#include "Physics/PhysicalAnimationSystem.h"
Namespace
Mowo

Tick order: runs AFTER PhysicsSystem (bodies already stepped this frame) and AFTER AnimationSystem (boneMatrices carry the animated pose). It drives the motors toward the just-computed animated pose, reads the stepped bodies back, and blends them into the chain's bones by the current physics weight. Because the sim is fixed-step (1/60) and this runs post-step, the readback samples a settled pose and the motor targets set here take effect on the next step.

Public functions

ReturnsNameDescription
voidInitialize
voidShutdown
voidUpdate
std::vector<uint8_t>ResolveChainChain = the named root bone plus (when includeChildren) every descendant.
std::vector<FPhysicalAnimationProfile>ResolveBoneProfilesMotor gains per bone: the component profile everywhere, replaced on each override's bone and (when it includes children) that bone's descendants.
floatDecayImpulseWeightPulse decay: the physics contribution falls to zero over recoverTime.
floatEffectiveWeightEffective per-frame physics weight applied to the chain bones.

Function details

Initialize

C++
void Initialize(World* world) override

Shutdown

C++
void Shutdown() override

Update

C++
void Update(float deltaTime) override

ResolveChain

C++
static std::vector<uint8_t> ResolveChain(const Skeleton& skeleton, const std::string& rootBoneName, bool includeChildren)

Chain = the named root bone plus (when includeChildren) every descendant. Empty rootBoneName selects the whole skeleton. Returns a per-bone mask (1 = in chain). Pure — no physics, CPU-testable.

ResolveBoneProfiles

C++
static std::vector<FPhysicalAnimationProfile> ResolveBoneProfiles(const Skeleton& skeleton, const PhysicalAnimationComponent& pa)

Motor gains per bone: the component profile everywhere, replaced on each override's bone and (when it includes children) that bone's descendants. Later overrides win on overlap, so a broad entry can be narrowed by a deeper one. Bones outside the driven chain get an entry too — the caller only reads the driven ones. Pure — no physics, CPU-testable.

DecayImpulseWeight

C++
static float DecayImpulseWeight(float current, float dt, float recoverTime)

Pulse decay: the physics contribution falls to zero over recoverTime.

EffectiveWeight

C++
static float EffectiveWeight(bool continuous, float blendWeight, float impulseWeight)

Effective per-frame physics weight applied to the chain bones.

Generated from Physics/PhysicalAnimationSystem.h via physics.json · Nov 4, 2026Version 1.0.0