API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classSegmentShape
A zero-thickness boundary between two local-space endpoints: level edges, one-off walls, the geometry a body may not cross. It has no interior, so Shape.massProperties is `null` and the shape contributes collision only - a `dynamic` body needs at least one mass-bearing collider alongside it. A segment blocks from **both** sides. There is no inside for it to be outside of, and a one-sided segment would be a gameplay rule in a geometry costume: express that with the world's `contactModifier`, which decides per contact and per step whether it is solved. Being zero-thickness makes it the worst case for discrete detection - a body that crosses it entirely within one fixed step misses it. Continuous collision covers a fast body against a segment; a fast segment is not swept.
import { SegmentShape } from '@codexo/exojs-physics'A zero-thickness boundary between two local-space endpoints: level edges, one-off walls, the geometry a body may not cross.
It has no interior, so Shape.massProperties is `null` and the shape contributes collision only - a `dynamic` body needs at least one mass-bearing collider alongside it.
A segment blocks from **both** sides. There is no inside for it to be outside of, and a one-sided segment would be a gameplay rule in a geometry costume: express that with the world's `contactModifier`, which decides per contact and per step whether it is solved.
Being zero-thickness makes it the worst case for discrete detection - a body that crosses it entirely within one fixed step misses it. Continuous collision covers a fast body against a segment; a fast segment is not swept.
new(x0: number, y0: number, x1: number, y1: number): SegmentShapeboundingRadius: numberlength: numbermassProperties: nullnormals: readonly number[]type: "segment"vertices: readonly number[]