RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorExport (glTF)Follow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track (Gymkhana Generator)Rectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot Creator (Vehicle Thumbnails)ShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files Syntaxutil/vehicleRopeDebug - Rope Physics Debug UIutil/worker - Batch Job Workerutil/wsTest - WebSocket Test Server
Track Builder - Basic BordersTrack Builder - Basic CentersTrack Builder - Border Wall MeshTrack Builder - Camera TransitionTrack Builder - Ceiling MeshtrackBuilder/markers - Track Marker Interpolation & VisualizationtrackBuilder/materialUtil - Track Material ManagementtrackBuilder/meshes - Cross-Section Mesh DefinitionstrackBuilder/multiTrackMerger - Track Intersection MergingtrackBuilder/obstaclePlacer - Track Obstacle PlacementtrackBuilder/pieces - Track Piece Geometry GenerationtrackBuilder/proceduralPrimitives - Procedural 3D Primitive GeneratorstrackBuilder/quickraceSetup - Quick Race Track LoadertrackBuilder/segmentToProceduralMesh - Segment Mesh GeneratortrackBuilder/splineTrack - Main Track Builder Engine

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

trackBuilder/segmentToProceduralMesh - Segment Mesh Generator

Reference for `extensions/util/trackBuilder/segmentToProceduralMesh.lua`. Converts track segments (with computed spline points) into ProceduralMesh objects rendered in the scene.

Reference for extensions/util/trackBuilder/segmentToProceduralMesh.lua. Converts track segments (with computed spline points) into ProceduralMesh objects rendered in the scene.


Exports

KeySignatureDescription
materialize(segment)Generates and applies the procedural mesh for a segment
calculatePointCoordinateSystem(segment)Computes per-point orientation vectors (nx, ny, nz)
compileMeshInfo(segment, lod?)Collects mesh data from all sub-generators
rotateVectorByQuat(v, q) → vec3Vector rotation helper
clearShapes()Clears cached shape data in basicCenters
getReferences() → tableReturns {basicCenters, basicBorders} for use by other modules

Internals

  • Sub-generators imported via require:
    • basicCenters - center road surface mesh
    • basicBorders - border/edge strip mesh
    • borderWall - side wall mesh
    • ceilingMesh - overhead ceiling mesh
  • Coordinate system: For each control point with sufficient quality level, computes three orthogonal vectors from finalRot: nx (right), ny (forward), nz (up).
  • LOD: Three detail levels are stored, but currently all set to the same mesh (meshes[1] = meshes[2] = meshes[3]).
  • ProceduralMesh creation: If the segment has no existing mesh object, one is created and registered in MissionGroup. Otherwise, the existing object is updated via createMesh.

Internal State

FieldTypeDescription
M.settingsvariesAssigned as settings


How It Works

  1. materialize(segment) is called after spline points and interpolation values are computed.
  2. calculatePointCoordinateSystem derives orientation vectors for each point.
  3. compileMeshInfo gathers meshes from all four sub-generators (centers, borders, walls, ceiling).
  4. The combined mesh array is passed to ProceduralMesh:createMesh() for rendering.
  5. Submesh indexes are tracked in segment.submeshIndexes for per-submesh material assignment.
-- After spline computation and interpolation:
mesher.materialize(segment)
-- segment.mesh now holds a ProceduralMesh scene object

-- Access sub-generator references for intersection merging:
local refs = mesher.getReferences()
-- refs.basicCenters, refs.basicBorders

Additional Exports

  • M.calculatePointCoordinateSystem - (undocumented)
  • M.clearShapes - (undocumented)
  • M.compileMeshInfo - (undocumented)
  • M.getReferences - (undocumented)
  • M.materialize - (undocumented)
  • M.rotateVectorByQuat - (undocumented)

trackBuilder/quickraceSetup - Quick Race Track Loader

Reference for `extensions/util/trackBuilder/quickraceSetup.lua`. Loads a saved track and sets up checkpoints/vehicle positioning when a quick race scenario starts.

trackBuilder/splineTrack - Main Track Builder Engine

Reference for `extensions/util/trackBuilder/splineTrack.lua`. The central module of the track editor - manages track pieces, converts them to spline geometry, handles markers, materials, checkpoints,

On this page

ExportsInternalsInternal StateHow It WorksAdditional Exports