Simulation

Animation

30 symbols, imported from @driftengine/animation.

Explained in Animation.

Classes

AnimationStateMachine
BlendTree
RigidAnimation
A clip bound to a list of nodes, one per joint the clip's tracks name.
Skeleton

Interfaces

AnimationState
States over blend trees, and crossfaded transitions between them.
AnimationTransition
Pose
A pose: one transform per joint, as three flat arrays rather than an array of objects.
RetargetMap
Playing one skeleton's clip on another.
RootMotion
A root's displacement over an interval. Three floats and a quaternion, both caller-owned.
SpringLink
One link of a chain: a spring, plus where it sits relative to the link above it at rest.
SpringSettings

Functions

addPose
Apply delta on top of base, scaled by weight, into out.
applyPoseToNode
Write one joint of a pose onto a node's local transform. Allocates nothing.
blendPoses
Blend a toward b by t, into out.
buildRetargetMap
Match two skeletons by joint name.
createPose
A pose sized for jointCount joints, already at rest.
createRootMotion
A zero displacement, ready to be written into. Identity rather than zeroed, as createPose is.
extractRootMotion
Write the root's displacement between fromSec and toSec into out. Allocates nothing.
restPose
Write the rest pose — no translation, identity rotation, unit scale — into an existing pose.
retargetPose
Write source, played on from, onto to in out. Allocates nothing.
sampleClip
Sample every track into out. Pure, allocation-free, and it reads no clock.
sampleSpring
Where the mass sits at timeSec, given where its anchor has been.
sampleSpringChain
Where every link of a chain sits at timeSec. Writes three floats per link into out.
setJoint
Write one joint's transform straight into a pose.
solveTwoBone
Reach target with the chain root → mid → tip, writing the two rotations into pose.
springChainSettleSec
The same, for a chain, which remembers longer than any of its links.
springSettleSec
How long until the spring's memory of an input is negligible.
stripRootMotion
Pin a sampled pose's root to the value the clip authored at time zero.

Types

BlendNode
A tree of clips blended by parameters the game names.
SpringAnchor
Where the mass is being pulled, as a pure function of time. Writes three floats into out.