API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classLine
Mutable line segment defined by two endpoint positions. Implements ShapeLike 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 ShapeLike 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): Line clone(): this collidesWith(_target: Collidable): CollisionResponse | null contains(x: number, y: number, threshold: number): boolean copy(line: Line): this destroy(): void equals(__namedParameters: Partial<Line>): boolean getBounds(): Rectangle getNormals(): Vector[] intersectsWith(target: Collidable): boolean project(axis: Vector, result: Interval): Interval set(x1: number, y1: number, x2: number, y2: number): this collisionType: CollisionType fromPosition: Vector fromX: number fromY: number toPosition: Vector toX: number toY: number temp: Line