Skip to content

five-on-it / packages/world/src/geometry

packages/world/src/geometry ​

What the level's triangles say about the ground: how high it is anywhere (surfaceHeight: the plane, or the highest up-facing triangle of a terrain piece there, so a terrace, a ramp, a hillside, the hidden slope under a flight of stairs), how steep it is (groundSlope), whether a point on it is clear of everything built (isOpenGround), what carries a road (supportHeight) and what colour that is under a tyre (supportAt). Every placement's triangles are baked into world space once per level and bucketed on a coarse grid, so a query touches a handful of triangles; the bake is memoised per level object. Pure and deterministic. Isomorphic: no DOM, no Node.

Interfaces ​

Variables ​

Functions ​