Class
AnimationPlugin
View sourceExtendsPlugin
Adds animation playback and animation-clip asset support to an App.
Use AnimationPlayer with AnimationClip assets to control
playback and animate entities through AnimationTarget. Playback
advances from the app clock provided by VirtualClock, and sampled
tracks apply their values to the target components they describe.
Animation clips are available through the AnimationClipAssets
resource alias for typed Assets access. Add
AssetServerPlugin when clips should be loaded through
AssetServer.
The app requires CorePlugin, ReflectPlugin, and
TimePlugin for animation support.
Examples
import { App } from '@wimaengine/app'
import { AssetServerPlugin } from '@wimaengine/asset'
import { AnimationPlugin } from '@wimaengine/animation'
import { CorePlugin } from '@wimaengine/core'
import { ReflectPlugin } from '@wimaengine/reflect'
import { TimePlugin } from '@wimaengine/time'
new App()
.registerPlugin(new ReflectPlugin())
.registerPlugin(new CorePlugin())
.registerPlugin(new AssetServerPlugin())
.registerPlugin(new TimePlugin())
.registerPlugin(new AnimationPlugin())
.run()Constructor
Methods
register(app: App): void
View sourceInstalls animation hooks, clip assets, and playback behavior in an
App.
AnimationPlayer components use AnimationClip assets and
release their live handles when removed. The installed
AnimationClipAssets resource provides typed clip access, while
playback advances from VirtualClock and sampled tracks apply
values to AnimationTarget entities.
requires(): TypeId[]
View sourceReturns the plugin dependencies required by animation support.
Register CorePlugin, ReflectPlugin, and
TimePlugin before this plugin. Registering this plugin does not
install missing dependencies automatically.
