Track Builder - Border Wall Mesh
Generates vertical wall meshes for left and right track borders with configurable height.
Generates vertical wall meshes for left and right track borders with configurable height.
Overview
util_trackBuilder_borderWallMesh creates box-shaped wall geometry that extends vertically from the track edges. Each wall has four sides (inner, outer, top, bottom) and supports per-point variable height via leftWallHeight / rightWallHeight fields on track points.
Module path: lua/ge/extensions/util/trackBuilder/borderWallMesh.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
getMeshes | (segment) → table | Returns wall mesh data for active left/right walls. |
Internals
Wall Geometry
Each wall cross-section has 4 vertices per track point:
- Base at track edge (width offset, below surface).
- Base at track edge + 1 unit outward (below surface).
- Top at track edge + 1 unit outward (at wall height).
- Top at track edge (at wall height).
The wall height comes from point.leftWallHeight or point.rightWallHeight.
Face Layout
The precomputed shape.faceInfo defines 24 face vertices per segment pair (4 quads × 2 triangles × 3 vertices), covering all four wall sides.
Start/End Caps
Wall caps use dedicated front/back face definitions that differ for left and right walls (winding order is mirrored). Controlled by segment.meshInfo.leftWall.startCap/endCap.
UV Mapping
- U: Fixed values (0, 0.125, -0.2, or height-based) per wall vertex.
- V:
point.uvY * uvHeightfor along-track tiling.
Normals
Four normals per point: down (-nz), outward (±nx), up (nz), inward (∓nx).
Quality Gate
Returns empty at quality level 4.
Activation
Walls are only generated when segment.meshInfo.leftWall.active or segment.meshInfo.rightWall.active is true.
How It Works
- Track builder marks walls as active and sets height per point.
getMeshes(segment)compiles left and/or right wall meshes.- Wall vertices follow the track width and orientation.
Lua Examples
-- Used internally by track builder:
local wallMeshes = extensions.util_trackBuilder_borderWallMesh.getMeshes(segment)
-- Returns: {leftWallMesh or nil, rightWallMesh or nil}Additional Exports
M.getMeshes- (undocumented)