Skip to content

@modoki/engine / index / EmitterShape

Interface: EmitterShape

Particles

angle?

optional angle?: number

cone half-angle, degrees


axis?

optional axis?: [number, number, number]

cylinder: axis direction the length runs along (need not be unit length — normalized at runtime). Default (0,1,0).


fromShell?

optional fromShell?: boolean

emit from the shell/surface only (vs the full volume) — legacy shorthand for radiusStart === radiusEnd. Superseded by radiusStart/radiusEnd.


length?

optional length?: number

cylinder: full length along axis. Default 1.


points?

optional points?: [number, number][]

polyline (2D): emit along a connected chain of line segments in the emitter's local XY plane. Each entry is a point [x, y]; particles spawn uniformly by arc length across all segments (a long segment gets proportionally more particles). Needs ≥2 points; with fewer it degrades to a point emitter at the first point (or the origin if empty). Ignored by non-polyline shapes. Use it to emit along a blade edge, a ground line, or a UI border.


radius?

optional radius?: number

sphere / circle / cone / cylinder base (outer) radius. With radiusStart/radiusEnd unset, this is the outer radius and the inner radius is 0 (solid) — or radius itself when fromShell is true (a thin surface).


radiusEnd?

optional radiusEnd?: number


radiusStart?

optional radiusStart?: number

Annular emission: particles spawn in the band between radiusStart (inner) and radiusEnd (outer) for cone/sphere/circle/cylinder, with uniform area/volume density (r = sqrt(mix(in², out², u)) for discs, cbrt for the sphere volume). When unset they fall back to the legacy radius/fromShell pair: outer = radiusEnd ?? radius ?? 1, inner = radiusStart ?? (fromShell ? outer : 0). So {radius:R} is a solid disc/ball and {radius:R, fromShell:true} is a thin shell — both reproduced exactly.


size?

optional size?: [number, number, number]

box half-extents [x,y,z]


sizeEnd?

optional sizeEnd?: [number, number, number]


sizeStart?

optional sizeStart?: [number, number, number]

Hollow box emission: particles spawn in the frame between an inner box (sizeStart, half-extents) and an outer box (sizeEnd, half-extents). When sizeStart is unset the box is a solid volume filled uniformly from sizeEnd ?? size. Half-extents, matching size.


type

type: EmitterShapeType

Built with Modoki.