AnimConstruct class
Mixin base for animation state machine Constructs. PrePhysics applies root motion; PostPhysics runs the state machine and writes CAnimBase/CAnimLayer.
Public functions
-
auto GetSocketTransform(SocketID socket,
const CAnimBase<FieldWidth::
Scalar>& animBase, const CAnimLayer<FieldWidth:: Scalar>& animLayer, uint32_t skeletonID) -> BoneTransform - Lazily evaluates the FK chain via BoneCache. Call RegisterSockets() first. PostPhysics only.
- void RegisterSockets(uint32_t skeletonSlot)
- Register sockets from a skeleton asset slot ID; no-op if the asset is not yet loaded.
- void RegisterSockets(const AssetDataRef<SkeletonAsset>& skelRef)
- Register sockets from a pre-resolved asset reference; populates SocketTransforms from SocketDef entries.
Protected static functions
- static auto WrapTimestamp(SimFloat& inOutT, float duration, bool loops) -> bool
- Clamp or wrap
inOutTto [0, duration] according toloops. Returns true if a loop occurred. -
static auto EvaluateBlendedBone(uint32_t boneIndex,
const CAnimBase<FieldWidth::
Scalar>& animBase, const CAnimLayer<FieldWidth:: Scalar>& animLayer) -> BoneTransform
Protected functions
- void BeginAnimTick()
- Clear bone and socket caches at the start of each PostPhysics tick.
- void StoreRootMotionDelta(uint32_t animID, SimFloat fromT, SimFloat toT)
- Sample the root motion delta for
animIDover [fromT, toT] and store it in RootMotionDelta{X,Y,Z}. -
void ApplyRootMotion(FieldProxy<SimFloat, FieldWidth::
Scalar>& posX, FieldProxy<SimFloat, FieldWidth:: Scalar>& posY, FieldProxy<SimFloat, FieldWidth:: Scalar>& posZ) - Accumulate the stored root motion delta into the entity's world position fields.
-
template<typename Derived>void FireNotifies(Derived* self, uint32_t animID, uint32_t slot, SimFloat fromT, SimFloat toT, SimFloat weight)
Protected variables
Function documentation
static BoneTransform AnimConstruct:: EvaluateBlendedBone(uint32_t boneIndex,
const CAnimBase<FieldWidth:: Scalar>& animBase,
const CAnimLayer<FieldWidth:: Scalar>& animLayer) protected
Evaluate the fully blended local-space transform for a single bone on the CPU. Applies base/fade replace blend first, then additive overlay layers on top of the normalized result.
template<typename Derived>
void AnimConstruct:: FireNotifies(Derived* self,
uint32_t animID,
uint32_t slot,
SimFloat fromT,
SimFloat toT,
SimFloat weight) protected
Fire any notifies in animID whose trigger times fall within [fromT, toT], skipping duplicates. Calls self->OnAnimNotify(NotifyFireEvent) for each qualifying notify.