API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceCollidable
@codexo/exojs / math / stable
Contract for objects that participate in collision detection. Implemented by all concrete shape classes as well as `SceneNode`.
1
props
5
methods
0
events
Import
import { Collidable } from '@codexo/exojs'Contract for objects that participate in collision detection. Implemented by all concrete shape classes as well as `SceneNode`.
Methods5
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): booleanReturns 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.
intersectsWith(target: Collidable): booleanTest 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.
project(axis: VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…, 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…Project this shape onto axis and write the scalar min/max into interval. Used internally by the SAT solver.
Properties1
Source