API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classVector
Concrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared scratch instance for intermediate calculations - never store the reference across frames. `Vector.zero` and `Vector.one` are read-only sentinel constants. The four static factory methods (`add`, `subtract`, `multiply`, `divide`) always allocate a new `Vector`. Instance methods mutate in place and return `this` for chaining.
import { Vector } from '@codexo/exojs'Concrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider).
`Vector.temp` provides a shared scratch instance for intermediate calculations - never store the reference across frames. `Vector.zero` and `Vector.one` are read-only sentinel constants.
The four static factory methods (`add`, `subtract`, `multiply`, `divide`) always allocate a new `Vector`. Instance methods mutate in place and return `this` for chaining.
new(x: number, y: number): Vectoradd(x: number, y: number): thisclone(): thiscollidesWith(_target: CollidableContract for objects that participate in collision detection. Implemented by all concrete shape classes as well as `SceneNode`.): CollisionResponseResult of a successful Collidable.collidesWith call. Contains the two participating shapes, the penetration depth, containment flags, and the minimum-translati… | nullcontains(x: number, y: number): booleancopy(vector: Vector): thiscross(vector: T): numberdestroy(): voiddistanceTo(vector: T): numberdivide(x: number, y: number): thisdot(x: number, y: number): numberequals(__namedParameters: Partial<T>): booleangetBounds(out: RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…): RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…getNormals(): Vector[]invert(): thismax(): numbermin(): numbermultiply(x: number, y: number): thisnormalize(): thisperp(): thisproject(_axis: Vector, interval: IntervalA closed scalar interval `[min, max]` used by the SAT collision solver to represent the projection of a shape onto a separating axis. `Interval.temp` provides…): IntervalA closed scalar interval `[min, max]` used by the SAT collision solver to represent the projection of a shape onto a separating axis. `Interval.temp` provides…rperp(): thisset(x: number, y: number): thissubtract(x: number, y: number): thisadd(v1: Vector, v2: Vector): Vectordivide(v1: Vector, v2: Vector): Vectormultiply(v1: Vector, v2: Vector): Vectorsubtract(v1: Vector, v2: Vector): Vectorx: numbery: numberone: Vectorzero: Vectorangle: numberlength: numberlengthSq: numbertemp: Vector