AnimationPlugin

View source

ExtendsPlugin

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


constructor()

Methods


requires(): TypeId[]

View source

Returns the plugin dependencies required by animation support.

Register CorePlugin, ReflectPlugin, and TimePlugin before this plugin. Registering this plugin does not install missing dependencies automatically.

Returns

Required plugin TypeId values.