ParticleEmitterComponent class Particles
An engine component that simulates a ParticleSystem on the CPU and draws its live particles as one instanced batch of camera-facing billboards.
Attach it to a node like any other component; the node's transform places and orients the emitter (particles simulate in the node's local space, so they move with it). Each frame update advances the system by the frame delta and copies the live particle columns into a BillboardGeometry, which the inherited mesh-component machinery renders, culls, and bounds.
Configure the effect through the system (shape, spawner, modules, start distributions, gravity) and the material (texture, tint, blend mode). Set facing/velocityStretch for spark-like streaks.
- Inheritance
-
- Object
- Component
- MeshComponent
- ParticleEmitterComponent
Constructors
- ParticleEmitterComponent({required ParticleSystem system, SpriteMaterial? material})
-
Creates an emitter that drives
system. Whenmaterialis omitted a default SpriteMaterial (untextured, alpha-blended) is used; configure its texture, tint, and blend mode for the effect.factory
Properties
- aspectRatio ↔ double
-
Billboard width as a multiple of the particle's size (height stays the
size itself).
1.0keeps square sprites.getter/setter pair - enabled ↔ bool
-
Whether this component's update hook runs each frame.
getter/setter pairinherited
- facing ↔ BillboardFacing
-
How the billboards orient toward the camera (see BillboardFacing).
getter/setter pair
- flipbookBlend ↔ bool
-
Whether fractional frames crossfade between adjacent flipbook cells
(see BillboardGeometry.flipbookBlend).
getter/setter pair
- flipbookColumns ↔ int
-
Flipbook atlas columns and rows for the material's texture.
1 x 1(the default) samples the whole texture; pair a larger grid with aFlipbookModuleso particles animate through the cells.getter/setter pair - flipbookRows ↔ int
-
Flipbook atlas rows (see flipbookColumns).
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
- material → SpriteMaterial
-
The material the billboards are drawn with (texture, tint, blend mode).
no setter
- mesh ↔ Mesh
-
The mesh this component draws.
getter/setter pairinherited
- node → Node
-
The node this component is attached to.
no setterinherited
- paused ↔ bool
-
When true, the simulation holds (the current particles keep rendering but
stop advancing). Useful for editor scrubbing or off-screen emitters.
getter/setter pair
- randomFlipX ↔ bool
-
When true, each particle has a stable 50% chance of rendering mirrored
horizontally (negative width), doubling a flipbook's apparent variety
for free.
getter/setter pair
-
renderItems
→ List<
RenderItem> -
The render items registered for this component's mesh primitives, empty
while not mounted. Exposed so a subclass (the LOD component) can tag the
items it just registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- system → ParticleSystem
-
The simulation this emitter advances and renders.
final
- velocityStretch ↔ double
-
World units of extra length added per unit of speed when facing is
BillboardFacing.velocityStretched.
getter/setter pair
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.
fixedDtis 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.
inherited
-
onRenderItemsRegistered(
) → void -
Called after this component registers its render items, on mount and on
every re-registration (mesh assignment,
refreshMaterials).inherited -
onUnmount(
) → void -
Called when the owning node leaves a live scene graph.
inherited
-
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.
deltaSecondsis the elapsed time since the previous tick.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited