API reference

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

C

classInterval

@codexo/exojs / math / stable

A 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 a shared scratch instance for hot paths. `Interval.zero` is a read-only `[0, 0]` sentinel.

4
props
8
methods
0
events
Import
import { Interval } from '@codexo/exojs'

A 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 a shared scratch instance for hot paths. `Interval.zero` is a read-only `[0, 0]` sentinel.

Constructors1
new(min: number, max: number): Interval
Methods8
clone(): this
containsInterval(interval: Interval): boolean
Return true when interval is strictly contained within this interval (exclusive bounds).
copy(interval: Interval): this
destroy(): void
getOverlap(interval: Interval): number
Return the signed overlap length between this interval and interval. Positive when they overlap; the sign encodes which end overlaps more. Used by the SAT solver to compute penetration depth.
includes(value: number): boolean
Return true when value lies within [min, max] (inclusive).
overlaps(interval: Interval): boolean
Return true when this interval and interval share at least one point.
set(min: number, max: number): this
Properties4
max: number
min: number
zero: Interval
temp: Interval
Source