API reference

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

C

classTurbulence

@codexo/exojs-particles / particles / stable

Adds a smooth pseudo-random force field that animates over time. Implemented as 2D value noise with cubic Hermite smoothing — sampled twice per particle (offset to decorrelate x and y components) and scaled by `strength`. The field evolves at `timeScale` units per second; lower values produce slow-moving currents, higher values produce buzzy chaos. `frequency` controls the spatial granularity: small values (≈ 0.005) yield broad swirls across the playfield, large values (≈ 0.1) produce tight per-particle jitter. Use cases: smoke turbulence, organic swirls, wind eddies, dust haze. Pair with Drag to keep particle velocities bounded. GPU-eligible. The noise function is identical on CPU and GPU so visual results match across backends (modulo float precision).

3
props
5
methods
0
events
Import
import { Turbulence } from '@codexo/exojs-particles'

Adds a smooth pseudo-random force field that animates over time. Implemented as 2D value noise with cubic Hermite smoothing — sampled twice per particle (offset to decorrelate x and y components) and scaled by `strength`. The field evolves at `timeScale` units per second; lower values produce slow-moving currents, higher values produce buzzy chaos.

`frequency` controls the spatial granularity: small values (≈ 0.005) yield broad swirls across the playfield, large values (≈ 0.1) produce tight per-particle jitter.

Use cases: smoke turbulence, organic swirls, wind eddies, dust haze. Pair with Drag to keep particle velocities bounded.

GPU-eligible. The noise function is identical on CPU and GPU so visual results match across backends (modulo float precision).

Constructors 1
new(strength: number, frequency: number, timeScale: number): Turbulence
Methods 5
apply(system: ParticleSystem, dt: number): void
destroy(): void
uploadTextures(device: GPUDevice, textures: ReadonlyMap<string, GPUTexture>): void
wgsl(): WgslContribution
writeUniforms(view: DataView, offset: number, dt: number): void
Properties 3
frequency: number
strength: number
timeScale: number
Source