makeAnimator()
A clip player for one rigged entity: the current clip, a crossfade from the previous one, and the clip events crossed since the last update. Pure and headless; one per animated instance, since it holds that instance's time.
function makeAnimator(entity: Entity, initial?: string): Animator;Defined in: engine/src/animation/animator.ts:46
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | Entity | A rigged entity (rig and clips); without clips it stays at rest. |
initial? | string | Clip to start on. Default the first clip. |
Returns
The animator.
Example
const anim = makeAnimator(rat, "walk");
anim.play("run", { fade: 0.1 });
for (const e of anim.update(dt)) if (e.name === "step") footstep();
const matrices = poseMatrices(rat.rig!, anim.pose());invertRigid()
Inverse of a rigid 3x4 (rotation transposed, translation mapped back).
makeCrowd()
Animate many rigged entities on a budget. Each update picks every member's pose frame (at fps near the camera, farFps beyond near, frozen beyond freeze), takes the baked pose from a cache shared by members of the same variant, bakes missing ones within budgetMs (a member that does not fit keeps...