DefaultTweenPlugin

View source

ExtendsPlugin

Enables standard transform tweening for an App.

It supports the following transform tween pairs: Position2D/Position2DTween, Position3D/Position3DTween, Orientation2D/Orientation2DTween, Orientation3D/Orientation3DTween, Scale2D/Scale2DTween, and Scale3D/Scale3DTween. Position and scale use Vector2.lerp or Vector3.lerp, while orientation uses Rotary.slerp or Quaternion.slerp.

The app must provide CorePlugin and TimePlugin before this plugin. Because TimePlugin depends on ReflectPlugin, register that plugin as well. Dependencies are not installed automatically.

Examples

import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { ReflectPlugin } from '@wimaengine/reflect'
import { TimePlugin } from '@wimaengine/time'
import { DefaultTweenPlugin } from '@wimaengine/tween'

new App()
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .registerPlugin(new TimePlugin())
  .registerPlugin(new DefaultTweenPlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Enables the standard transform tween integrations for an app.

Parameters

NameDescriptionDefault
app

App to configure.

—