TownGround.module
This package holds more than this page lists. See all of its files in its world.
README.md
TownGround
The land of a planned town, as pure functions of the plan, plus the meshes and colliders that stand it. TownGround.new(plan) answers a ground object: G:heightAt(x, z) is the height a foot meets (paddy floors, river and moat beds included), G:surfaceAt(x, z) the sengokuMaterials surface drawn there (packedEarth, rakedGravel, paddyMud, cutStone and others), G:footstepAt(x, z) the footstep surface (wood, tatami, stone, earth, paddyWater, gravel, grass), G:waterAt(x, z) the water height or nil, and G:zoneAt(x, z) the zone (castle, moat, street, market, town, temple, river, paddies, grove, field). G:build(parent, look) makes chunked ground meshes, one per surface per chunk, with exact static colliders tagged with their footstep surface, and the water planes of the moat, river and every flooded paddy (G:waterGeometry()); G:setLook(look) swaps materials in place and G:destroy() removes it all. Heights and surfaces use only arithmetic and Noise. Built by TownBuilder; read by TownScatter (placement heights), Footsteps, Atmos and the CastleTown component's town().ground.