Skip to content

Animation

DownDraft provides a comprehensive animation system with skeletal animation, GLTF skinning, GPU compute skinning, and Mixamo retargeting.

import { AnimationPlayer } from "@downdraft/engine";
const player = new AnimationPlayer();
player.play("idle", { weight: 1.0, fadeIn: 0.2 });
import { AnimationStateMachine } from "@downdraft/engine";
const sm = new AnimationStateMachine();
sm.addState("idle", { clip: idleClip });
sm.addState("walk", { clip: walkClip });
sm.addTransition("idle", "walk", { condition: "speed > 0.5" });
  • Skeletal animation — Keyframe tracks for bone transforms
  • GLTF skinning — Automatic skinning from GLTF/GLB files
  • GPU compute skinning — Bone transforms computed on GPU for performance
  • Mixamo retargeting — Strip mixamorig: prefix, T-pose to A-pose calibration, cached bone-mapping table
  • Blend trees — 1D and 2D blend trees for smooth transitions between animations

Animation clips contain keyframe tracks — one per animated property (position, rotation, scale) per bone. Clips can be loaded from GLTF files or created programmatically.

A skeleton defines the bone hierarchy and bind poses. Skeletons are shared across entities that use the same rig.

The retargeting system allows animations created for one skeleton to be applied to another. Mixamo-specific retargeting handles:

  • Stripping the mixamorig: prefix from bone names
  • T-pose to A-pose calibration
  • Cached bone-mapping tables for performance