Emitter3DPlugin

View source

ExtendsPlugin

Adds 3D particle emission and lifetime cleanup to an App.

Enabled entities with an Emitter, a GlobalTransform3D, and a Timer emit world-space particles when a configured emission cycle begins. Each particle receives the emitter’s current position, orientation, and scale and is removed after its lifetime is complete.

The plugin requires CorePlugin, CommandsPlugin, TimePlugin, and Transform3DPlugin. Register these dependencies before registering this plugin; the app checks them but does not install them automatically.

Examples

import { App } from '@wimaengine/app'
import { CommandsPlugin } from '@wimaengine/command'
import { CorePlugin } from '@wimaengine/core'
import { Emitter3DPlugin } from '@wimaengine/emitter'
import { TimePlugin } from '@wimaengine/time'
import { Transform3DPlugin } from '@wimaengine/transform'

new App()
  .registerPlugin(new CorePlugin())
  .registerPlugin(new CommandsPlugin())
  .registerPlugin(new TimePlugin())
  .registerPlugin(new Transform3DPlugin())
  .registerPlugin(new Emitter3DPlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Enables 3D particle emission and lifetime cleanup for the app.

Parameters

NameDescriptionDefault
app

App to configure.

—

requires(): TypeId[]

View source

Returns the plugin IDs required for 3D particle emission and cleanup.

Returns

Required plugin TypeId values.