API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTurbulence
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).
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).
new(strength: number, frequency: number, timeScale: number): Turbulence 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 frequency: number strength: number timeScale: number