API ReferenceGE ExtensionsutiltrackBuilder
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.
Reference for extensions/util/trackBuilder/markers.lua. Manages visual editor markers (bank, height, width, checkpoints, walls, ceiling) and interpolates track properties between control points.
Exports
| Key | Signature | Description |
|---|---|---|
interpolate | (nameOfField, track) | Interpolates a named field across the track segments |
interpolatePointsOfSegment | (segment, startValue, endValue, startLength, endLength, nameOfField) | Interpolates points within a single segment |
interpolateOverPoints | (nameOfField, track) | Point-based interpolation pass |
interpolateOverSegments | (nameOfField, track) | Segment-based interpolation pass |
interpolateSingle | (nameOfField, track) | Single-segment interpolation (checkpoints) |
interpolateField | (name, t, a, b, point, length) | Applies a specific field's interpolation function |
transformMarkers | (name, allNodes) | Positions/rotates visual markers for a field type |
hideMarkers | (name) | Hides all markers of a given type |
clearMarkers | (name) | Deletes all marker objects of a given type |
addMarkerChange | (name, index) | Marks a piece index as needing re-interpolation |
unloadAll | () | Resets all marker lists |
caps | (segments, closed) | Calculates start/end cap flags for mesh segments |
names | table | List of marker field names: bank, height, width, checkpoint, leftWall, rightWall, ceilingMesh |
Interpolation Functions (also exported)
| Key | Signature | Description |
|---|---|---|
step | (t) → value, slope | No interpolation (constant) |
linear | (t) → value, slope | Linear ramp 0→1 |
pow2 | (t) → value, slope | Quadratic ease |
pow3 | (t) → value, slope | Cubic ease |
pow4 | (t) → value, slope | Quartic ease |
smoothSlope | (t) → value, slope | Hermite smooth step (zero slope at endpoints) |
smootherSlope | (t) → value, slope | Perlin smoother step |
Internals
- Marker types are defined in a
typestable mapping each field name to its interpolation strategy (points,segments,both,single), interpolation function, transform function, and optional cap function. - Visual markers are
TSStaticobjects created on-demand and pooled viaexpandTruncateList. Colors distinguish types: red=bank, blue=height, green=width, white=checkpoint, orange=walls. - markerChanges tracks which piece indices need re-interpolation per field name. After interpolation, the changes are cleared.
- Cap logic determines whether mesh start/end caps are needed at boundaries between different wall/mesh values.
How It Works
- When a user edits a marker (e.g. bank angle),
addMarkerChange("bank", pieceIndex)is called. interpolate("bank", track)dispatches to the correct strategy - for bank/height/width it usesinterpolateOverPoints, which finds bracketing control points and interpolates intermediate segment points.- Each point receives computed values (bank angle, width, zOffset, pitch) using the chosen easing function (smooth, linear, etc.).
transformMarkers("bank", allNodes)repositions the 3D marker objects in the scene.caps(segments, closed)updates mesh cap flags so adjacent segments with different meshes get proper end/start caps.
-- Mark piece 5's bank as changed and re-interpolate
markers.addMarkerChange("bank", 5)
markers.interpolate("bank", track)
markers.transformMarkers("bank", allNodes)
markers.caps(track, isClosed)Additional Exports
M.addMarkerChange- (undocumented)M.caps- (undocumented)M.clearMarkers- (undocumented)M.hideMarkers- (undocumented)M.interpolate- (undocumented)M.interpolateField- (undocumented)M.interpolateOverPoints- (undocumented)M.interpolateOverSegments- (undocumented)M.interpolatePointsOfSegment- (undocumented)M.interpolateSingle- (undocumented)M.linear- (undocumented)M.names- (undocumented)M.pow2- (undocumented)M.pow3- (undocumented)M.pow4- (undocumented)M.smoothSlope- (undocumented)M.smootherSlope- (undocumented)M.step- (undocumented)M.transformMarkers- (undocumented)M.unloadAll- (undocumented)
Track Builder - Ceiling Mesh
Generates ceiling/tunnel mesh geometry above track segments in the track builder system.
trackBuilder/materialUtil - Track Material Management
Reference for `extensions/util/trackBuilder/materialUtil.lua`. Manages track surface materials (colors, textures, glow, ground type) for the 8 material slots (A–H) used by the track editor.