Animation · interface
Pose
A pose: one transform per joint, as three flat arrays rather than an array of objects.
Explained in Animation.
interface Poseimport type { Pose } from '@driftengine/animation';In depth
Structure-of-arrays because a pose is bulk data on a hot path. A rig is sixty to ninety joints and a scene holds several characters, so a pose per character per frame as objects is exactly the allocation the performance rules forbid. Three typed arrays are claimed once and written in place for the character's whole life, and the palette they resolve into is contiguous for the same reason.
What it costs is that reading one joint is three indexed reads rather than a property access.
What would make it wrong is a caller needing to hold a single joint's transform as a value —
which blend.ts's setJoint answers by writing rather than by handing one out.
Properties
| Name | Type | Description |
|---|---|---|
translationreadonly | Float32Array | Three floats a joint. |
rotationreadonly | Float32Array | Four floats a joint, xyzw, in the order gl-matrix uses. |
scalereadonly | Float32Array | Three floats a joint. |