API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classConeDirection
Random unit vector inside a cone, scaled by a speed magnitude. The cone is centred on `directionAngle` (in radians, 0 = +X, π/2 = +Y for screen-down coordinates) and spans `±halfAngle` radians around it. Speed is sampled uniformly in `[minSpeed, maxSpeed]`. Use for emission cones, explosions, fountain spread — anywhere the direction has a preferred axis with bounded variance.
import { ConeDirection } from '@codexo/exojs-particles' Random unit vector inside a cone, scaled by a speed magnitude.
The cone is centred on `directionAngle` (in radians, 0 = +X, π/2 = +Y for screen-down coordinates) and spans `±halfAngle` radians around it. Speed is sampled uniformly in `[minSpeed, maxSpeed]`.
Use for emission cones, explosions, fountain spread — anywhere the direction has a preferred axis with bounded variance.
new(directionAngle: number, halfAngle: number, minSpeed: number, maxSpeed: number): ConeDirection sample(out: Vector): Vector omni(minSpeed: number, maxSpeed: number): ConeDirection directionAngle: number halfAngle: number maxSpeed: number minSpeed: number