API reference

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

I

interfaceReadonlyRectangle

@codexo/exojs / math / stable

Read-only view of a Rectangle: every accessor and non-mutating query a rectangle offers, with none of its writers. Returned by APIs that hand out a LIVE internal rectangle for zero allocation cost - SceneNode.getLocalBounds being the canonical one. Those rectangles are read on hot per-frame paths, so cloning them defensively would add a per-frame allocation; the view costs nothing at runtime and removes the write at the type level instead. Owners keep a real Rectangle and expose a dedicated writer that also runs whatever invalidation the write implies. Same idea as a `readonly T[]`: the object underneath is still the mutable one, the view just does not offer a way to change it.

9
props
10
methods
0
events
Import
import { ReadonlyRectangle } from '@codexo/exojs'

Read-only view of a Rectangle: every accessor and non-mutating query a rectangle offers, with none of its writers.

Returned by APIs that hand out a LIVE internal rectangle for zero allocation cost - SceneNode.getLocalBounds being the canonical one. Those rectangles are read on hot per-frame paths, so cloning them defensively would add a per-frame allocation; the view costs nothing at runtime and removes the write at the type level instead. Owners keep a real Rectangle and expose a dedicated writer that also runs whatever invalidation the write implies.

Same idea as a `readonly T[]`: the object underneath is still the mutable one, the view just does not offer a way to change it.

Methods10
Compute a full CollisionResponse between this shape and target. Returns null in two cases: - the shapes do not overlap, **or** - the specific shape-pair combination does not support response generation (e.g. Line against any shape, Ellipse against Ellipse or Polygon). Use intersectsWith for a universal boolean overlap check that works across all supported shape pairs.
contains(x: number, y: number): boolean
Returns true if the point (x, y) is inside this shape.
Return the outward-facing edge normals used by the SAT solver. The array should be cached and reused across calls.
Test whether this shape overlaps target using a fast boolean algorithm (no penetration depth or normal computed). Prefer this over collidesWith when only the yes/no result is needed.
Properties9
bottom: number
height: number
left: number
right: number
top: number
width: number
x: number
y: number
Source