MeshParticleEmitterComponent class Particles

An engine component that simulates a ParticleSystem on the CPU and draws each live particle as an instance of a 3D mesh, one instanced draw per geometry.

Where ParticleEmitterComponent renders camera-facing billboards, this component renders real geometry, debris chunks, rocks, shards, coins. Passing several geometries gives free variety: each particle picks one for life by its stable per-particle random, the way sprite systems pick a random flipbook cell. All geometries share one material.

The particle's size is a uniform scale, its rotation spins it per facing, and position/velocity/lifetime behave exactly as they do for sprite particles, so the same modules drive both renderers.

Per-particle color is not applied to mesh instances. TODO(particles): per-instance color needs an instanced color attribute on the mesh instancing path; route ColorOverLife through it once that lands.

Inheritance

Constructors

MeshParticleEmitterComponent({required ParticleSystem system, required List<Geometry> geometries, required Material material, MeshParticleFacing facing = MeshParticleFacing.tumble})
Creates an emitter that draws system's particles as instances of geometries (each particle picks one), all sharing material.

Properties

enabled bool
Whether this component's update hook runs each frame.
getter/setter pairinherited
facing MeshParticleFacing
How instances orient (tumble around their axis, or fly point-first).
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isAttached bool
Whether this component is currently attached to a node.
no setterinherited
isLoaded bool
Whether onLoad has completed.
no setterinherited
isMounted bool
Whether the owning node is part of a live scene graph.
no setterinherited
node Node
The node this component is attached to.
no setterinherited
paused bool
When true, the simulation holds (current particles keep rendering but stop advancing).
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
system ParticleSystem
The simulation this emitter advances and renders.
final

Methods

cloneFor(Node cloneOwner) Component?
Returns a copy of this component for cloneOwner, the Node.clone counterpart of the owning node, or null to not carry the component to clones (the default).
inherited
fixedUpdate(double fixedDt) → void
Called once per fixed physics step while the component is mounted, enabled, and loaded. fixedDt is the fixed timestep of the surrounding PhysicsWorld, not the frame interval.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAttach() → void
Called when this component is added to a node.
inherited
onDetach() → void
Called when this component is removed from a node.
inherited
onLoad() Future<void>
Optional asynchronous setup, such as loading an asset.
inherited
onMount() → void
Called when the owning node enters a live scene graph.
override
onUnmount() → void
Called when the owning node leaves a live scene graph.
override
toString() String
A string representation of this object.
inherited
update(double deltaSeconds) → void
Called once per frame while the component is mounted, enabled, and loaded. deltaSeconds is the elapsed time since the previous tick.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited