API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classPolygonShape
A convex polygon defined by ≥3 local-space vertices. Input vertices may be given in either winding; they are canonicalised to counter-clockwise and the outward edge normals are precomputed. Construction throws on any non-convex, degenerate, or under-specified input - there is no silent repair. Vertices and normals are exposed as flat `[x0, y0, x1, y1, ...]` arrays to keep the narrow phase allocation-free; both are frozen.
import { PolygonShape } from '@codexo/exojs-physics'A convex polygon defined by ≥3 local-space vertices. Input vertices may be given in either winding; they are canonicalised to counter-clockwise and the outward edge normals are precomputed. Construction throws on any non-convex, degenerate, or under-specified input - there is no silent repair.
Vertices and normals are exposed as flat `[x0, y0, x1, y1, ...]` arrays to keep the narrow phase allocation-free; both are frozen.
new(vertices: readonly Readonly<PointLikeStructural type for any object with a 2D `x`/`y` position.>[]): PolygonShapeboundingRadius: numbercount: numbernormals: readonly number[]type: "polygon"vertices: readonly number[]