API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceDistribution

@codexo/exojs-particles / particles / stable

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).

0
props
1
methods
0
events
Import
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).

Methods1
sample(out?: T): T
Source