five-on-it / packages/world/src/pieces
packages/world/src/pieces
The pieces a level is made of in the Babylon.js Editor, and the mapping between their placements and LevelData. A piece is a source mesh the designer places as an instance: one of the eighteen unit blocks (block:<kind>, parked under the _blocks group, each marked by a block script; the boxes and wedges the first levels were built from, with their unit meshes defined here so no file has to be read for them, the markers (a spawn point with its role), and the interactables: a door (a gate, a barrier), a container or pickup, a security camera, an NPC spawner (with its role and schedule), a vehicle spawner, a garage, a shop's counter; and a district's area) or a piece of a kit modelled in Blender (its mesh and what it is come with the scene, see apps/tools). The exporter turns every placement into the placed meshes, roads and points the simulation understands, and the port goes the other way for the blocks.
Placements are expressed in the game's frame (metres, right-handed, +y up, yaw 0 facing +z): the mirror between the editor's left-handed scene and the game is applied by the tools, never here. Isomorphic: no DOM, no Node, no Babylon.
Classes
Interfaces
Type Aliases
Variables
- BLOCK_COLORS
- BLOCK_KINDS
- BLOCK_LIBRARY_NODE
- BLOCK_MESHES
- BLOCK_PARAMS
- BLOCK_SCRIPT_KEYS
- BLOCK_SOURCE_NAMES
- KIT_LIBRARY_NODE
- STAIRS_SLOPE_MESH