Skip to content

five-on-it / apps/client/src/renderer/figure

apps/client/src/renderer/figure ​

A character's figure, animated every frame by the clips (clips.ts) the state machine picks (anim-state.ts): a base clip for the whole figure, an upper clip over it, and one-shots on top when something happens (a recoil, a punch, a door; a landing, getting up, which the figure notices itself). A change of clip crossfades from the pose shown in FADE seconds; a one-shot plays once and hands back (a full one-shot takes the whole figure, an upper one leaves the legs to the base). A locomotion clip plays by the distance covered (its stride), and its legs are turned toward the way the figure moves (strafing, backing away), not the way it faces.

Getting up from lying is drawn too: the simulation stands a knocked-down character upright in one tick, and the figure turns from how it lay to upright over half a second while its get-up clip plays. A node without parts (a wireframe box before the models arrive) is left alone. The figure keeps its pose itself (Figure.turns, Figure.rootAt, Figure.rootTurn): it sets it on the part nodes of a clone of the model (the player's own), and the batches (models.ts) read it for an actor they draw. Before the clips are loaded the figure stands at rest.

Classes ​

Interfaces ​

Type Aliases ​

Variables ​

Functions ​