RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager
Road Architect - ClothoidRoad Architect - DecalsRoad Architect - ExportRoad Architect - GeometryRoad Architect - GroupsRoad Architect - ImportRoad Architect - JunctionsRoad Architect - LinkRoad Architect - OverlaysRoad Architect - ProfilesRoad Architect - RenderRoad Architect - Road MeshRoad Architect RoadsRoad Architect - Static MeshRoad Architect - Static Mesh ManagerRoad Architect - TerraformRoad Architect - Tunnel MeshRoad Architect Utilities

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 ExtensionseditortechroadArchitect

Road Architect - Static Mesh

Places static meshes (TSStatic objects) along road lanes - both spanning meshes repeated along length and single-unit patch meshes at specific positions.

Places static meshes (TSStatic objects) along road lanes - both spanning meshes repeated along length and single-unit patch meshes at specific positions.


Public API

FunctionSignatureDescription
M.createStaticMeshes(r, roadIdx, folder)Creates all static meshes for a road based on its profile layers
M.tryRemove(roadName)Removes all static meshes for the given road name

Key Internals

FunctionDescription
createSelectedMeshPlaces spanning meshes along a lane at regular intervals with optional spacing/jitter
createSingleMeshUnitPlaces a single mesh at a specific longitudinal position on the road
computePolylineLengthsComputes cumulative lengths along a polyline

Code Example

local staticMeshMgr = require('editor/tech/roadArchitect/staticMesh')

-- Create static meshes for a road inside a scene folder
local folder = createObject("SimGroup")
folder:registerObject("Road Architect - Road 1")
scenetree.MissionGroup:addObject(folder)

staticMeshMgr.createStaticMeshes(road, 1, folder)

-- Remove static meshes
staticMeshMgr.tryRemove(road.name)

-- Layer types that trigger static mesh creation:
-- layerType == 4 → spanning mesh (repeated along road length)
-- layerType == 5 → single mesh unit (placed at specific position)

-- Spanning mesh placement algorithm:
-- 1. Collect lane edge positions from renderData
-- 2. Compute polyline lengths
-- 3. Place mesh units at intervals of (meshLength + extraSpacing)
-- 4. Orient each mesh using tangent vector and normal
-- 5. Apply pre-rotation (0°/90°/180°/270°) and random jitter

-- Single mesh placement:
-- 1. Evaluate longitudinal position as fraction of road length
-- 2. Interpolate between div points for position/normal/lateral
-- 3. Apply vertical and lateral offsets
-- 4. Compute rotation from road frame + pre-rotation

-- Pre-rotation quaternions:
-- rot_q0   = quat(0,0,0,1)         -- 0°
-- rot_q90  = quat(0,0,√2/2,√2/2)   -- 90°
-- rot_q180 = quat(0,0,1,0)         -- 180°
-- rot_q270 = quat(0,0,-√2/2,√2/2)  -- 270°

-- Ray casting snaps meshes to terrain:
-- orig.z = orig.z - castRayStatic(orig, downVec, 1000) + 0.02

Dependencies

ModulePurpose
editor/tech/roadArchitect/utilitiespolyLerp, computeDivIndicesFromNode, findBounds

See Also

  • Road Architect - Clothoid - Related reference
  • Road Architect - Decals - Related reference
  • Road Architect - Export - Related reference
  • World Editor Guide - Guide

Road Architect Roads

- `M.addIntermediateNode`

Road Architect - Static Mesh Manager

Manages the static mesh audition system - searching for available meshes, previewing them with a rotating camera, and computing bounding box data for profile layers.

On this page

Public APIKey InternalsCode ExampleDependenciesSee Also