advanceAnimationPlayers

View sourceadvanceAnimationPlayers(world: World): void

Advances every Playback registered in every AnimationPlayer component.

AnimationPlugin registers this exact function directly in the repeating AppSchedule.Update schedule. It does not specify a system group, so CoreSystems.Main is used by schedules created by CorePlugin. The animation update sequence samples tracks after playback time has been advanced.

A fresh Query finds the world’s current AnimationPlayer tables for this invocation. The function reads world.getResource(VirtualClock).getDelta() once and passes that value to Playback#update for every playback. Paused playbacks still receive the call; Playback#update decides whether elapsed time changes. The world must contain the VirtualClock resource, or resource lookup throws.

Examples

import { AppSchedule } from '@wimaengine/core'
import { advanceAnimationPlayers } from '@wimaengine/animation'

app.registerSystem({
  schedule: AppSchedule.Update,
  system: advanceAnimationPlayers
})
// AnimationPlugin already registers this system for its app.

Parameters

NameDescriptionDefault
world

World containing AnimationPlayer components and a VirtualClock resource.

—