API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceDistribution
Value distribution sampled at particle spawn time. Each `sample()` call may return a different value - used to randomize spawn properties (lifetime, position, velocity, scale, tint, ...) without per-particle subclassing. Implementations come in two flavours: - **Stateless / scalar** (e.g. Constant, Range) just return a `T` directly. - **Mutable-target** (Vector / Color distributions) accept an optional `out` parameter and write into it in place. Pass your own scratch instance to avoid per-spawn heap allocations; omit it to use the distribution's internal scratch (only valid until the next call).
import { Distribution } from '@codexo/exojs-particles'Value distribution sampled at particle spawn time. Each `sample()` call may return a different value - used to randomize spawn properties (lifetime, position, velocity, scale, tint, ...) without per-particle subclassing.
Implementations come in two flavours:
- **Stateless / scalar** (e.g. Constant, Range) just return a `T` directly. - **Mutable-target** (Vector / Color distributions) accept an optional `out` parameter and write into it in place. Pass your own scratch instance to avoid per-spawn heap allocations; omit it to use the distribution's internal scratch (only valid until the next call).
sample(out?: T): T