Animation Presets
Animation Presets
Section titled “Animation Presets”Ready-to-use animation configurations for character movement and behavior.
Quick Start
Section titled “Quick Start”import { createAnimationPreset, AnimationPresets } from '@strata-game-library/presets/animation';
<Character animation={AnimationPresets.HUMANOID_WALK} />Available Presets
Section titled “Available Presets”| Preset | Description | Use Case |
|---|---|---|
HUMANOID_WALK | Bipedal walk cycle | Human characters |
HUMANOID_RUN | Bipedal run cycle | Human running |
QUADRUPED_WALK | Four-legged walk | Dogs, horses |
QUADRUPED_RUN | Four-legged run | Fast animals |
BIRD_FLY | Wing flapping | Flying creatures |
FISH_SWIM | Undulating motion | Aquatic |
SPIDER_CRAWL | Eight-legged | Arachnids |
Preset Examples
Section titled “Preset Examples”Humanoid Walk
Section titled “Humanoid Walk”AnimationPresets.HUMANOID_WALK = { type: 'procedural',
gait: { speed: 1.5, strideLength: 0.8, strideDuration: 0.6, },
body: { bounce: 0.03, sway: 0.02, lean: 0.05, },
arms: { swing: 0.3, swingOffset: Math.PI, },
legs: { lift: 0.15, bendAngle: 0.4, },
ik: { footPlacement: true, hipAdjustment: true, },};Quadruped Run
Section titled “Quadruped Run”AnimationPresets.QUADRUPED_RUN = { type: 'procedural',
gait: { pattern: 'gallop', speed: 8, strideLength: 2.5, },
body: { bounce: 0.15, stretch: 0.1, },
legs: { frontPhase: 0, backPhase: 0.5, lift: 0.4, },
spine: { flex: 0.2, twist: 0.1, },};Using with Components
Section titled “Using with Components”import { Character } from '@strata-game-library/core';import { AnimationPresets } from '@strata-game-library/presets/animation';
<Character model={characterModel} animation={isRunning ? AnimationPresets.HUMANOID_RUN : AnimationPresets.HUMANOID_WALK}/>Related
Section titled “Related”- Characters - Character system
- Camera Presets - Camera following
- Physics Presets - Physics settings