RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorVehicle ExporterFollow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track GeneratorRectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot CreatorShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files SyntaxVehicle Rope DebugBatch WorkerWebSocket Test
Basic BordersBasic CentersBorder Wall MeshCamera TransitionCeiling MeshTrack MarkersMaterial UtilTrack MeshesMulti Track MergerObstacle PlacerTrack PiecesProcedural PrimitivesQuickrace SetupSegment To Procedural MeshSpline Track

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE ExtensionsutiltrackBuilder

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)

FunctionSignatureDescription
getMeshes(segment) → tableReturns 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───3

Points 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 = 10 subdivisions 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.nz

UV Mapping

  • U: Distance along cross-section from center × uv.width.
  • V: point.uvY * uv.height for 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.active is 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

  1. Track builder marks ceilingMesh.active = true and sets ceilingMeshHeight per point.
  2. getMeshes(segment) precomputes width LUT, then compiles the mesh.
  3. 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 quality

Additional Exports

  • M.getMeshes - (undocumented)

See Also

  • Track Builder - Basic Borders - Related reference
  • Track Builder - Basic Centers - Related reference
  • Track Builder - Border Wall Mesh - Related reference
  • Game Engine Overview - Guide

Camera Transition

Smoothly lerps the free camera from its current position/rotation to a target over a specified duration.

Track Markers

Reference for `extensions/util/trackBuilder/markers.lua`. Manages visual editor markers (bank, height, width, checkpoints, walls, ceiling) and interpolates track properties between control points.

On this page

OverviewExports (M)InternalsCross-Section ShapeWidth-Based LUTCeiling HeightUV MappingStart/End CapsQuality and ActivationOutput FormatHow It WorksLua ExamplesAdditional ExportsSee Also