API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classLine
Mutable line segment defined by two endpoint positions. Implements Collidable for intersection tests against all shape types. Note: `collidesWith` always returns `null` - lines support boolean intersection only; SAT response is not implemented for line segments. `contains(x, y, threshold)` tests whether `(x, y)` lies on the segment within a configurable threshold (default `0.1`). `Line.temp` is a shared scratch instance.
import { Line } from '@codexo/exojs'Mutable line segment defined by two endpoint positions. Implements Collidable for intersection tests against all shape types.
Note: `collidesWith` always returns `null` - lines support boolean intersection only; SAT response is not implemented for line segments. `contains(x, y, threshold)` tests whether `(x, y)` lies on the segment within a configurable threshold (default `0.1`).
`Line.temp` is a shared scratch instance.
new(x1: number, y1: number, x2: number, y2: number): Lineclone(): thiscollidesWith(_target: CollidableContract for objects that participate in collision detection. Implemented by all concrete shape classes as well as `SceneNode`.): CollisionResponseResult of a successful Collidable.collidesWith call. Contains the two participating shapes, the penetration depth, containment flags, and the minimum-translati… | nullcontains(x: number, y: number, threshold: number): booleancopy(line: Line): thisdestroy(): voidequals(__namedParameters: Partial<Line>): booleangetBounds(out: RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…): RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…project(_axis: VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…, result: 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…set(x1: number, y1: number, x2: number, y2: number): thisfromX: numberfromY: numbertoX: numbertoY: numbertemp: Line