Examples
import { AppSchedule } from '@wimaengine/core'
import { emitParticles3D } from '@wimaengine/emitter'
app.registerSystem({
schedule: AppSchedule.Update,
system: emitParticles3D
})Function
emitParticles3D(world: World): voidEmits world-space 3D particle entities for eligible emitters.
The query matches entities with GlobalTransform3D, Emitter,
and Timer. Disabled emitters and emitters whose timer has not started
a cycle are skipped. For each remaining emitter, the system samples and rounds
the configured burst count, decomposes the current global transform, then
queues that many entities with copied Position3D,
Orientation3D, and Scale3D, a Particle marker,
and a Timer whose duration is a sampled lifetime.
When configured, Emitter#prefab supplies components before the
particle components are inserted. After each entity is built,
Emitter#patch receives the shared EntityCommands instance
and the new EntityHandle. Component insertion and later despawning
are deferred through the world’s command queue.
The emitter plugin registers this function in the repeating Update schedule.
import { AppSchedule } from '@wimaengine/core'
import { emitParticles3D } from '@wimaengine/emitter'
app.registerSystem({
schedule: AppSchedule.Update,
system: emitParticles3D
})