Class
Damping2DPlugin
View sourceExtendsPlugin
Adds scalar linear and angular damping to an App.
Register this plugin to provide Linear2DDamping and
Angular2DDamping resources and apply their values to matching 2D
motion components. It depends on CorePlugin,
ReflectPlugin, and Movable2DPlugin.
Examples
import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { Damping2DPlugin } from '@wimaengine/damping'
import { MathPlugin } from '@wimaengine/math'
import { Movable2DPlugin } from '@wimaengine/movable'
import { ReflectPlugin } from '@wimaengine/reflect'
new App()
.registerPlugin(new ReflectPlugin())
.registerPlugin(new CorePlugin())
.registerPlugin(new MathPlugin())
.registerPlugin(new Movable2DPlugin())
.registerPlugin(new Damping2DPlugin())
.run()Constructor
Methods
register(app: App): void
View sourceAdds the 2D damping resources to an App and enables damping for
matching 2D motion components.
The installed Linear2DDamping and Angular2DDamping
resources start with a value of 0.01. Their values are applied to
matching 2D linear and angular motion as the app updates.
requires(): TypeId[]
View sourceLists the plugins required by 2D damping.
The app must already have CorePlugin, ReflectPlugin,
and Movable2DPlugin registered. Registering this plugin does not
install those dependencies automatically.
