Animation · class

RigidAnimation

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

Explained in Animation.

class RigidAnimation
import { RigidAnimation } from '@driftengine/animation';

In depth

The pose is claimed once at construction and reused, so apply allocates nothing however often it runs.

Constructor

new

constructor(clip: AnimationClip, nodes: readonly (SceneNode | null)[])
ParameterTypeDescription
clipAnimationClip
nodesreadonly (SceneNode | null)[]Indexed by joint. null for a joint this scene did not instantiate.

Methods

apply

apply(timeSec: number): void

Sample at a caller-supplied time and write every bound node. Reads no clock.

ParameterTypeDescription
timeSecnumber
More

A joint with no node is skipped rather than refused. An imported clip names joints a scene may not have instantiated, and the right behaviour is the parts that exist moving — the reliability rules forbid throwing in a frame loop outright, and a missing prop is not a reason to stop a scene.