Editor Gen Test
Internal test/debug module for the Building Architect Tool (BAT) procedural generation system. Contains test routines for mesh generation, DAE export, LOD creation, XML manipulation, and building geom
Internal test/debug module for the Building Architect Tool (BAT) procedural generation system. Contains test routines for mesh generation, DAE export, LOD creation, XML manipulation, and building geometry validation.
Module Overview
| Aspect | Detail |
|---|---|
| File | extensions/editor/gen/test.lua |
| Module | M (local table) |
| Requires | editor/gen/utils, editor/gen/mesh, editor/gen/top, editor/gen/network, editor/gen/region |
| Role | Development-only test harness for procedural building systems |
Public Functions
| Function | Description |
|---|---|
M.clear(forestName) | Wipes all test objects from the bat SimGroup, removes generated DAE/JSON files, and recreates the Forest object |
M.pretest_BAT(inworld) | Sets up pre-test camera positions and optional in-world test geometry (roads, decals, regions) |
M.test_BAT(p) | Main test entry point - exercises mesh creation, DAE import/export, LOD generation, XML editing, building scanning, roof geometry, and robot scene tests |
Key Capabilities Tested
- Mesh generation:
ProceduralMeshcreation, vertex colors, UV mapping, face winding - DAE pipeline: XML parsing (
xmlOn), node manipulation (forNode,toNode,ofNode), LOD insertion, material replacement, file export (xml2file) - Building geometry: Wall paving (
rcPave,framePave,frameSpline), roof ridge/gable generation, polygon splitting - Forest items: Creation, positioning, transform updates via
editor.updateForestItem - Material loading: Reading material JSON files, setting up BAT-specific material variants
Usage Context
-- Only runs in development mode (U._PRD == 0)
local Tst = require('/lua/ge/extensions/editor/gen/test')
Tst.test_BAT() -- Run full test suite
Tst.pretest_BAT(true) -- Set up in-world test scene
Tst.clear('theForest') -- Wipe all test artifactsNote: This module is gated behind
U._PRD == 0checks and contains extensive commented-out experimental code. Not intended for production use.
Exported Functions
M.inject(olist)
Injects module dependencies and triggers onUp.
olist(table?) -{E, W, UI, UU}module references
M.onUp(arg)
Activates the test/conf editor mode, reloads modules, shows LAT/TEST windows.
arg(any) - Optional argument
M.clear(forestName)
Wipes all test objects, generated files (DAE/JSON), and recreates the Forest object.
forestName(string) - Name of the Forest scene object to recreate
Returns: Forest - The newly created Forest object
M.pretest_BAT(inworld)
Sets up camera positions and optional in-world test geometry.
inworld(boolean?) - If true, places player and generates test roads/regions
M.test_BAT(p)
Main test entry point - exercises mesh, DAE, LOD, XML, building, and roof geometry.
p(vec3?) - Optional position
See Also
- Gen Decal Editor - Related reference
- Gen Experimental Frame Editor - Related reference
- Gen Mesh Explorer - Related reference
- World Editor Guide - Guide
Gen Terrain Module
Procedural terrain and road lattice generation module for the gen editor.
Editor Gen Top (Roof Geometry)
Roof geometry generation module for the Building Architect Tool. Handles polygon decomposition, parallel-pair detection, ridge/gable/flat roof construction, and triangulated paving of arbitrary polygo