Skip to content

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

packages/world/src/level ​

Level data: what the simulation and the renderer build a level from. A level is a set of meshes (low-poly triangle lists with the colours they are drawn in) and the placements of those meshes (where each stands, how it is turned and scaled, what it is for the navigation and how it collides), plus the roads (polylines with lanes and a speed: what the AI drives on and the maps draw, no collider of their own), the spawn points, the nail strips and the range dummies. The ground is an implicit slab the size of groundHalfSize with its top at y = 0; everything else is a placement. The same triangles are what the server collides with, what the client draws and what the navigation reads (surfaceHeight, isOpenGround in geometry.ts), so what you see is what you hit. Levels are authored in the Babylon.js Editor project (apps/level-editor) out of unit blocks and of kits modelled in Blender, and exported to packages/world/levels/; the registry of the bundled ones is the entry @foi/world/levels.

Coordinates are metres, right-handed, +y up, yaw 0 facing +z and turning toward +x; on the screen +z is up (north) and +x on the left (west), so east is −x (see the levels guide's Directions). A placement is scaled, then pitched around its own x axis, then yawed, then moved. Triangles are wound counter-clockwise seen from outside.

Interfaces ​

Type Aliases ​

Variables ​

Functions ​