gizgame/city
A city cell (Procgen cityCell) as it is drawn and as it stops a walker: its buildings of walls and panes (a room behind each pane: Maps.room), their roofs, its roads and its walks, one mesh per material, and a box for each solid part. The view streams cells about the eye (gizgame/view City3D); what is seen and what stops are one list of parts.
import * as City from "gizgame/city";Types
Solid
type Solid = { at: Point3; size: Point3; }A box that stops a walker: its middle and its size.
at:gizlang_geometry.Point3size:gizlang_geometry.Point3
Post
type Post = { role: string; at: Point3; yaw: f64; size: f64; }A thing the city stands somewhere: its ROLE ("lamp" on a walk, facing the road; "sofa", "armchair", "table", "desk", "plant" or "shelf" in a lobby), where it stands, the way it faces (a model's +z turned by YAW) and its height.
role:stringat:gizlang_geometry.Point3yaw:f64size:f64
Built
type Built = { meshes: Map<string, Geometry>; solids: Vec<Solid>; posts: Vec<Post>; }The meshes of a cell by what they show: "glass" (the panes), "roof", "road", "walk", "white" and "yellow" (paint), "inside", "floor" and "light" (a lobby's walls and ceiling, floor and light panels) and "wall N" (the Nth wall material), its SOLIDS and the POSTS along its walks.
meshes:_gizlang_sdk_collections.Map<string, gizlang_meshdraw.Geometry>solids:Vec<M198.Solid>posts:Vec<M198.Post>
Functions
built
function built(town: Town, height: (x: f64, z: f64) => f64, walls: i64, block: f64): BuiltThe cell TOWN on the ground of HEIGHT (taken at each block's middle: a block stands level), its walls of WALLS materials (houses take the first, the rest by the lot), its roads painted for crossings every BLOCK meters, as meshes and solids.
Effects: fail, read, write, console, io, alloc.
roomSheet
function roomSheet(size: i64 = 64): TextureThe room behind a pane (Maps.room: the six faces of its cube, 3 by 2, +x, -x, +y, -y, +z, -z in Unreal's axes, y into the room and z up), SIZE texels a face: pale walls lit from above with a dark skirting, a back wall with a picture, a ceiling with a lit panel and a wooden floor.
Effects: fail, alloc.
Constants
STOREY
const STOREY = 3.5One floor's height in meters.
BAY
const BAY = 4.0A room's width behind a pane, in meters.