API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classApplyForce
Adds a constant 2D acceleration to every live particle's velocity each frame. Use for gravity (`new ApplyForce(0, 980)`), wind, or any uniform force field. Force is applied to all particles equally — for per-particle variation, layer multiple ApplyForce modules with different gates. GPU-eligible: implements UpdateModule.wgsl so this module runs in the system's compute shader on WebGPU backends with no CPU readback.
import { ApplyForce } from '@codexo/exojs-particles' Adds a constant 2D acceleration to every live particle's velocity each frame. Use for gravity (`new ApplyForce(0, 980)`), wind, or any uniform force field. Force is applied to all particles equally — for per-particle variation, layer multiple ApplyForce modules with different gates.
GPU-eligible: implements UpdateModule.wgsl so this module runs in the system's compute shader on WebGPU backends with no CPU readback.
new(accelerationX: number, accelerationY: number): ApplyForce apply(system: ParticleSystem, dt: number): void destroy(): void uploadTextures(device: GPUDevice, textures: ReadonlyMap<string, GPUTexture>): void wgsl(): WgslContribution writeUniforms(view: DataView, offset: number): void accelerationX: number accelerationY: number