Track Builder - Ceiling Mesh
Generates ceiling/tunnel mesh geometry above track segments in the track builder system.
Generates ceiling/tunnel mesh geometry above track segments in the track builder system.
Overview
util_trackBuilder_ceilingMesh creates a box-shaped ceiling above the track using a width-dependent LUT system (like basicCenters). The ceiling height is configurable per point via point.ceilingMeshHeight. Used for tunnels and covered track sections.
Module path: lua/ge/extensions/util/trackBuilder/ceilingMesh.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
getMeshes | (segment) → table | Returns ceiling mesh data if the ceiling is active. |
Internals
Cross-Section Shape
A 7-point rectangular box profile:
1───6───7(=1)
│ │
2 5
│ │
3───4───3Points 2, 3, 5, 6 are marked sharp for hard edges. The shape forms a closed rectangular cross-section.
Width-Based LUT
Like basicCenters, precomputes vertices and normals for each width step:
- Width scaled by
LUTDetail = 10subdivisions per unit. - X coordinates scaled by
width/2. - Normals computed with smooth/sharp handling.
Ceiling Height
Each point's ceilingMeshHeight offsets the entire cross-section upward via:
point.ceilingMeshHeight * point.orientation.nzUV Mapping
- U: Distance along cross-section from center ×
uv.width. - V:
point.uvY * uv.heightfor along-track tiling.
Start/End Caps
Cap UVs are computed from the actual start/end point widths. Caps respect segment.meshInfo.ceilingMesh.startCap/endCap and forceStartCap/forceEndCap.
Quality and Activation
- Returns empty at quality level 4.
- Returns empty if
segment.meshInfo.ceilingMesh.activeis false.
Output Format
{
verts = {{x,y,z}, ...},
uvs = {{u,v}, ...},
normals = {{x,y,z}, ...},
faces = {{v, n, u}, ...},
material = "track_editor_A_center",
tag = "ceiling"
}How It Works
- Track builder marks
ceilingMesh.active = trueand setsceilingMeshHeightper point. getMeshes(segment)precomputes width LUT, then compiles the mesh.- The ceiling floats above the track surface at the specified height.
Lua Examples
-- Used internally by track builder:
local ceilingMeshes = extensions.util_trackBuilder_ceilingMesh.getMeshes(segment)
-- Returns: {ceilingMeshData} or {} if inactive/low qualityAdditional Exports
M.getMeshes- (undocumented)
Track Builder - Camera Transition
Smoothly lerps the free camera from its current position/rotation to a target over a specified duration.
trackBuilder/markers - Track Marker Interpolation & Visualization
Reference for `extensions/util/trackBuilder/markers.lua`. Manages visual editor markers (bank, height, width, checkpoints, walls, ceiling) and interpolates track properties between control points.