API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classObservableVector
A AbstractVector subclass that fires a callback whenever its components change. Used internally by Rectangle and other types to invalidate cached state (e.g. normals) on position mutations. Setting individual components (`x`, `y`) fires the callback only when the value actually changes. Batch mutations via `set()` fire at most one callback per call.
import { ObservableVector } from '@codexo/exojs' A AbstractVector subclass that fires a callback whenever its components change. Used internally by Rectangle and other types to invalidate cached state (e.g. normals) on position mutations.
Setting individual components (`x`, `y`) fires the callback only when the value actually changes. Batch mutations via `set()` fire at most one callback per call.
new(callback: object | null, x: number, y: number): ObservableVector add(x: number, y: number): this clone(): this copy(vector: AbstractVector): this cross(vector: T): number destroy(): void distanceTo(vector: T): number divide(x: number, y: number): this dot(x: number, y: number): number equals(__namedParameters: Partial<T>): boolean invert(): this max(): number min(): number multiply(x: number, y: number): this normalize(): this perp(): this rperp(): this scale(x: number, y: number): this set(x: number, y: number): this subtract(x: number, y: number): this transform(matrix: Matrix): this transformInverse(matrix: Matrix): this angle: unknown length: unknown lengthSq: number x: number y: number