Damping3DPlugin

View source

ExtendsPlugin

Adds scalar linear and angular damping to an App.

Register this plugin to provide Linear3DDamping and Angular3DDamping resources and apply their values to matching 3D motion components. It depends on CorePlugin, ReflectPlugin, and Movable3DPlugin.

Examples

import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { Damping3DPlugin } from '@wimaengine/damping'
import { MathPlugin } from '@wimaengine/math'
import { Movable3DPlugin } from '@wimaengine/movable'
import { ReflectPlugin } from '@wimaengine/reflect'

new App()
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .registerPlugin(new MathPlugin())
  .registerPlugin(new Movable3DPlugin())
  .registerPlugin(new Damping3DPlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Adds the 3D damping resources to an App and enables damping for matching 3D motion components.

The installed Linear3DDamping and Angular3DDamping resources start with a value of 0.01. Their values are applied to matching 3D linear and angular motion as the app updates.

Parameters

NameDescriptionDefault
app

App to configure.

—