Transform3DPlugin

View source

ExtendsPlugin

Adds 3D transform support to an App.

Register this plugin to compute global transforms from each entity’s local 3D position, orientation, and scale values. Entities in a hierarchy inherit their parent entities’ transforms. The plugin requires CorePlugin, ReflectPlugin, and HierarchyPlugin. Use Transform2DPlugin separately when an app also needs 2D transforms.

Examples

import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { HierarchyPlugin } from '@wimaengine/hierarchy'
import { ReflectPlugin } from '@wimaengine/reflect'
import { Transform2DPlugin, Transform3DPlugin } from '@wimaengine/transform'

new App()
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .registerPlugin(new HierarchyPlugin())
  .registerPlugin(new Transform2DPlugin())
  .registerPlugin(new Transform3DPlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Enables 3D transform support for an App.

Entities with local 3D position, orientation, and scale values receive composed global transforms, and child entities inherit their parent’s transform through the hierarchy.

Parameters

NameDescriptionDefault
app

App to configure.

—