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): ConeDirectionsample(out: VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…): VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…omni(minSpeed: number, maxSpeed: number): ConeDirectiondirectionAngle: numberhalfAngle: numbermaxSpeed: numberminSpeed: number