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/proceduralPrimitives - Procedural 3D Primitive Generators

Reference for `extensions/util/trackBuilder/proceduralPrimitives.lua`. Generates mesh data (vertices, normals, UVs, faces) for primitive 3D shapes used as track obstacles.

Reference for extensions/util/trackBuilder/proceduralPrimitives.lua. Generates mesh data (vertices, normals, UVs, faces) for primitive 3D shapes used as track obstacles.


Exports

KeySignatureDescription
createRing(radius, thickness, material?) → meshTorus/ring shape
createCylinder(radius, height, material?) → meshCylinder with top/bottom caps
createCube(size, material?, uvStyle?) → meshBox with configurable UV layout
createCone(radius, height, material?) → meshCone with flat bottom
createBump(length, width, height, upperLength, upperWidth, material?) → meshTrapezoidal bump
createRamp(width, len, hei, thinning, attack, twist, material?) → meshRamp with configurable taper and curve

Internals

Mesh Format

All functions return a table with:

  • verts: {{x,y,z}, ...} - vertex positions
  • normals: {{x,y,z}, ...} - normal vectors
  • uvs: {{u,v}, ...} - texture coordinates
  • faces: {{v=idx, n=idx, u=idx}, ...} - triangle faces (0-indexed)
  • material: string - material name (default 'track_editor_A_border')

Shape Details

  • Ring: Generates a torus by sweeping an inner circle around an outer circle. Segment counts adapt to radius/thickness.
  • Cylinder: Side faces, top cap, and bottom cap. UV repeats based on height.
  • Ramp: Segmented along length with per-segment thinning and power-curve attack angle. Includes front/back end caps.
  • Bump: 8-vertex frustum shape (bottom rect → top rect) with analytical face normals.
  • Cone: Radial fan faces converging to apex plus flat bottom cap.
  • Cube: Two UV styles available (style 1 = standard, style 2 = rotated side UVs).

The module also contains an unexported createIcosphere function for debugging (creates and registers a ProceduralMesh directly).


How It Works

Each generator computes geometry analytically, with adaptive segment counts clamped to reasonable ranges. The mesh tables are consumed by ProceduralMesh:createMesh().

local prims = require('util/trackBuilder/proceduralPrimitives')

-- Create a ring obstacle
local ringMesh = prims.createRing(2, 0.5, 'track_editor_A_border')

-- Create a ramp: 5m wide, 10m long, 2m high, slight taper
local rampMesh = prims.createRamp(5, 10, 2, 0.5, 1.5, 0, 'track_editor_B_border')

-- Use with ProceduralMesh
local proc = createObject("ProceduralMesh")
proc:registerObject('myObstacle')
proc:createMesh({{ringMesh}})

Additional Exports

  • M.createBump - (undocumented)
  • M.createCone - (undocumented)
  • M.createCube - (undocumented)
  • M.createCylinder - (undocumented)
  • M.createRamp - (undocumented)
  • M.createRing - (undocumented)

trackBuilder/pieces - Track Piece Geometry Generation

Reference for `extensions/util/trackBuilder/pieces.lua`. Converts abstract track piece descriptions (forward, curve, spiral, loop, bezier) into concrete segment data with positions, headings, and cont

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.

On this page

ExportsInternalsMesh FormatShape DetailsHow It WorksAdditional Exports