RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Debug DrawingGPU Mesh StructsImGui FFIMath Structs (FFI)FFI C DefinitionsPID ControllersCSV LibraryDelay LineDequeDevelopment UtilitiesEvent ReferenceExtension SystemSignal FiltersGraph PathfindingUI BridgeInput Filter Constants2D Bilinear InterpolationIntrospectionJBeam Pretty PrinterJSON AST ParserSJSON ParserJSON Debug ParserJSON Pretty PrinterK-D Tree (2D Boxes)K-D Tree (3D)K-D Tree (3D)Lua SerializerC++/Lua BindingLua CoreLua ProfilerMath LibraryParticlesQuadtreeSettingsTCP ServerTimer SchedulerUtility Library
ExpressionParser ReferenceGroups ReferenceInteraction ReferenceIO ReferenceLinks ReferenceLoader ReferenceMaterials ReferenceOptimization ReferenceScaling ReferenceSectionMerger ReferenceSlotSystem ReferenceTableSchema ReferenceUtils ReferenceVariables Reference
Assorted ReferenceCamera ReferenceColors ReferenceEvents ReferenceLicensePlatesSkins ReferenceMeshs ReferenceMirror ReferenceNodeBeam ReferencePaints ReferenceVisual Ropes ReferenceWheels Reference

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 Referencecommonjbeamsections

Mirror Reference

Module defined in `lua/common/jbeam/sections/mirror.lua`. Processes mirror definitions from JBeam data, creating C++ mirror objects on the vehicle.

Module defined in lua/common/jbeam/sections/mirror.lua. Processes mirror definitions from JBeam data, creating C++ mirror objects on the vehicle.


Exports

Functions

M.process(objID, vehicleObj, vehicle)

Iterates the mirrors section and creates mirror objects via vehicleObj:addMirror(). Configures each mirror's mesh, reference nodes, offset position, and normal direction. Handles retrocompatibility for deprecated properties.

  • Parameters:
    • objID - number - Vehicle object ID
    • vehicleObj - userdata - C++ vehicle object
    • vehicle - table - Assembled vehicle data with mirrors section
  • Returns: self (module table, for chaining)

Internal Notes

  • Mirror creation: vehicleObj:addMirror(mesh, idRef, id1, id2) returns mirror ID.
  • Position: prefers refBaseTranslation, falls back to offset.
  • Normal direction: prefers baseRotationGlobal (Euler → quaternion → normal), falls back to normal (deprecated).
  • offsetRotationGlobal and offsetNormal are deprecated - logs error suggesting mesh normal fixes.
  • All rotations converted via quatFromEuler with math.rad.

See Also

  • Assorted Reference - Related reference
  • Camera Reference - Related reference
  • Colors Reference - Related reference
  • Common Libraries Overview - Guide

Meshs Reference

Module defined in `lua/common/jbeam/sections/meshs.lua`. Processes 3D mesh attachments: physics triangles, props (animated objects), and flexbodies (deformable meshes).

NodeBeam Reference

Module defined in `lua/common/jbeam/sections/nodeBeam.lua`. Processes core structural sections: nodes (position calculation), hydros (hydraulic actuators), ropes, and quads (pressure volumes).

On this page

ExportsFunctionsM.process(objID, vehicleObj, vehicle)Internal NotesSee Also