API reference

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

C

classConeDirection

@codexo/exojs-particles / particles / stable

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.

4
props
2
methods
0
events
Import
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.

Constructors 1
new(directionAngle: number, halfAngle: number, minSpeed: number, maxSpeed: number): ConeDirection
Methods 2
sample(out: Vector): Vector
omni(minSpeed: number, maxSpeed: number): ConeDirection
Properties 4
directionAngle: number
halfAngle: number
maxSpeed: number
minSpeed: number
Source