Simulation
Animation
30 symbols, imported from @driftengine/animation.
Explained in Animation.
Classes
AnimationStateMachineBlendTreeRigidAnimation- 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.
AnimationTransitionPose- 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
deltaon top ofbase, scaled byweight, intoout. applyPoseToNode- Write one joint of a pose onto a node's local transform. Allocates nothing.
blendPoses- Blend
atowardbbyt, intoout. buildRetargetMap- Match two skeletons by joint name.
createPose- A pose sized for
jointCountjoints, already at rest. createRootMotion- A zero displacement, ready to be written into. Identity rather than zeroed, as
createPoseis. extractRootMotion- Write the root's displacement between
fromSecandtoSecintoout. Allocates nothing. restPose- Write the rest pose — no translation, identity rotation, unit scale — into an existing pose.
retargetPose- Write
source, played onfrom, ontotoinout. 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 intoout. setJoint- Write one joint's transform straight into a pose.
solveTwoBone- Reach
targetwith the chainroot→mid→tip, writing the two rotations intopose. 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.