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
Vehicle Editor - Toolbar
Adjustable Tech Car TunerAero DebugCrash TesterFlexbody DebugGeneral DataJBeam PickerVehicle Editor - Lights DebugVehicle Editor - Node Triangle Self Collision DetectorVehicle Editor - Powertrain InspectorVehicle Editor - Prop TransformerVehicle Editor - Raw Vehicle DataVehicle Editor - TCS DebugVehicle Editor - Vehicle SpawnerVehicle Editor - Scene View

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 ExtensionseditorvehicleEditorliveEditor

Vehicle Editor - Lights Debug

Visualizes spotlight and point light props on the active vehicle in the Vehicle Editor, drawing debug spheres, direction arrows, and labels in 3D.

Visualizes spotlight and point light props on the active vehicle in the Vehicle Editor, drawing debug spheres, direction arrows, and labels in 3D.


Module Exports

ExportTypeDescription
M.menuEntrystring"Lights Debug" - label in vehicle editor menu
M.openfunctionOpens the debug window
M.onVehicleEditorRenderJBeamshookDraws light debug geometry each frame
M.onUpdatehookRenders the ImGui controls window
M.onSerializehookPersists window open state
M.onDeserializedhookRestores window open state

Key Internals

VariableTypePurpose
windowOpenBoolPtrTracks if the debug window is open
spotLightDebugEnabledBoolPtrToggle for spotlight visualization
pointLightDebugEnabledBoolPtrToggle for point light visualization
zTestEnabledBoolPtrEnables X-ray mode (disables depth test)
displayNamesBoolPtrShows function name labels at light positions
displayAsUnitVectorsBoolPtrNormalizes direction arrows to length 1

How It Works

The module iterates over all props in vEditor.vdata.props. For each prop whose mesh is "SPOTLIGHT" or "POINTLIGHT", it reads the live world transform, draws a colored sphere at the light position, and renders directional indicators:

  • Spotlights - direction line + two arrow-head triangles (rotated 90° for dual-angle visibility)
  • Point lights - solid sphere at position + transparent range sphere

Colors are derived from prop.lightColor (RGB 0–255 mapped to 0–1).


Lua Code Example

-- The module is loaded as a vehicle editor live extension
-- Registered via M.menuEntry = "Lights Debug"

-- Opening the window programmatically
extensions.editor_vehicleEditor_liveEditor_veLightsDebug.open()

-- The render hook draws debug geometry for all light props:
-- Spotlights get a direction arrow with two triangle heads
-- Point lights get a sphere showing their range

-- ImGui window exposes checkboxes:
-- "Spotlight Debug (SL)"  - toggle spotlight visualization
-- "Pointlight Debug (PL)" - toggle point light visualization
-- "X-Ray Mode"            - disable depth testing
-- "Display Names"         - show function name labels
-- "Unit Vectors"          - normalize direction arrows to length 1

-- Arrow heads use rotated quaternions for dual-angle visibility:
-- q1 = quatFromEuler(0, 0, math.pi * 11/12)
-- q2 = quatFromEuler(0, 0, -math.pi * 11/12)
-- q3 = quatFromEuler(0, math.pi / 2, 0)

-- Each spotlight arrow is drawn from two angles:
-- debugDrawer:drawTriSolid(tip, tip + q1*qDir*arrowHead + dir, tip + q2*qDir*arrowHead + dir, col)
-- debugDrawer:drawTriSolid(tip, tip + q1*q3*qDir*arrowHead + dir, tip + q2*q3*qDir*arrowHead + dir, col)

-- Point light range visualization:
-- debugDrawer:drawSphere(lightPos, 0.04, lightCol1)          -- center dot
-- debugDrawer:drawSphere(lightPos, prop.lightRange, lightCol2) -- range sphere (alpha=0.1)

-- Serialization saves/restores windowOpen state
-- so the debug window persists across editor reloads

See Also

  • Adjustable Tech Car Tuner - Related reference
  • Aero Debug - Related reference
  • Crash Tester - Related reference
  • World Editor Guide - Guide

JBeam Picker

Live editor app for interactively picking, inspecting, and monitoring nodes and beams in the 3D viewport - displays static JBeam data, live telemetry graphs, and supports text-based search.

Vehicle Editor - Node Triangle Self Collision Detector

Detects and visualizes nodes that are within collision radius of triangles they don't belong to, highlighting potential self-collision issues in JBeam vehicle data.

On this page

Module ExportsKey InternalsHow It WorksLua Code ExampleSee Also