API reference

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

C

classVelocityOverLifetime

@codexo/exojs-particles / particles / stable

Multiplies every live particle's velocity by a curve sampled at the particle's current `elapsed / lifetime` ratio. The same scalar is applied to both axes — the direction is preserved, only the magnitude scales. Common patterns: - **Snappy spawn, slow drift:** `[0,1]→[1,0.1]` — fast initial motion that decays over lifetime. - **Late acceleration:** `[0,0.2]→[1,1]` — particles ease in. - **Pulse:** sine-shaped curve for breathing-style motion. Note: the curve **replaces** velocity each frame relative to the previous frame's velocity, so the effect is multiplicative. Pair with `ApplyForce` if you want a constant external acceleration on top. GPU-eligible: uploads the curve as a 256-tap 1D R32F texture; sampled once per particle per frame.

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

Multiplies every live particle's velocity by a curve sampled at the particle's current `elapsed / lifetime` ratio. The same scalar is applied to both axes — the direction is preserved, only the magnitude scales.

Common patterns: - **Snappy spawn, slow drift:** `[0,1]→[1,0.1]` — fast initial motion that decays over lifetime. - **Late acceleration:** `[0,0.2]→[1,1]` — particles ease in. - **Pulse:** sine-shaped curve for breathing-style motion.

Note: the curve **replaces** velocity each frame relative to the previous frame's velocity, so the effect is multiplicative. Pair with `ApplyForce` if you want a constant external acceleration on top.

GPU-eligible: uploads the curve as a 256-tap 1D R32F texture; sampled once per particle per frame.

Constructors 1
new(curve: Curve): VelocityOverLifetime
Methods 5
apply(system: ParticleSystem, _dt: number): void
destroy(): void
uploadTextures(device: GPUDevice, textures: ReadonlyMap<string, GPUTexture>): void
wgsl(): WgslContribution
writeUniforms(view: DataView, byteOffset: number, dt: number): void
Properties 1
curve: Curve
Source