API reference

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

I

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): 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.
intersectsWith(target: Collidable): boolean
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.
Properties1
Source