API reference

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

C

classObservableVector

@codexo/exojs / math / stable

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.

5
props
21
methods
0
events
Import
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.

Constructors 1
new(callback: object | null, x: number, y: number): ObservableVector
Methods 21
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
Properties 5
angle: unknown
length: unknown
lengthSq: number
x: number
y: number
Source