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
ui/ambientSound - Ambient Sound Stream PlayerUI Apps ManagerUI AudioBindings LegendCamera Distance AppConsole (consoleNG)Credits MusicExternal App (WebSocket UI Server)Fade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsUI Navigation / MapVehicle Paint EditorVehicle Vicinity AppUI Visibility
Livery Editor - CameraLivery Editor - ControlsLivery Editor - Edit ModeLivery Editor – Editor (Core)Livery Editor – HistoryLivery Editor – Layer ActionLivery Editor – Layer EditLivery Editor – LayersLivery Editor – ResourcesLivery Editor – SelectionLivery Editor – ToolsLivery Editor – User DataLivery Editor – Utils

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 ExtensionsuiliveryEditor

Livery Editor - Camera

Camera management for the livery editor - orthographic views, orbit camera, and layer-based positioning.

Camera management for the livery editor - orthographic views, orbit camera, and layer-based positioning.


Overview

ui_liveryEditor_camera controls the camera during livery editing. It provides orthographic snap views (front, back, left, right, top variants), orbit camera switching, and the ability to position the camera based on layer data.

Extension path: lua/ge/extensions/ui/liveryEditor/camera.lua


Exports (M)

FunctionSignatureDescription
setOrthographicView(view)Snaps camera to a named orthographic view.
switchToOrbit(resetCam?)Switches to orbit camera mode.
setCameraByLayer(layer)Positions camera using layer's camPosition and camDirection.
setOrthographicViewByPosition(pos)Determines and sets view from a position vector.
setOrthographicViewLayer(layer)Sets orthographic view matching a layer's camera position.
getViewPointByLayer(layer)Returns the view name for a layer's camera position.
switchOrthographicViewByDirection(x, y)Cycles through views via directional input.
getOrthographicViewByPosition(pos)Maps a position to a view name (left/right/front/back/top*).
getCoordinatesByView(view)Returns coordinate mapping for a view.
getOrthographicView()Returns current orthographic view name.
getCoordinates()Returns coordinate mapping for current view.
orthographicViewstableNamed view rotation vectors.

Internals

Orthographic Views

Eight predefined views with rotation vectors:

local ORTHOGRAPHIC_VIEWS = {
  front = vec3(180, 0, 0),
  back = vec3(0, 0, 0),
  left = vec3(-90, 0, 0),
  right = vec3(90, 0, 0),
  topfront = vec3(180, -90, 0),
  topleft = vec3(-90, -90, 0),
  topright = vec3(90, -90, 0),
  topback = vec3(0, -90, 0),
  default = vec3(145, -5, 0)
}

Coordinate Mapping

Each view defines how screen X/Y maps to world axes. Used for decal placement in orthographic mode:

orientationCoordinates = {
  left = { x = {index=2, inverted=false}, y = {index=3, inverted=false} },
  right = { x = {index=2, inverted=true},  y = {index=3, inverted=false} },
  front = { x = {index=1, inverted=false}, y = {index=3, inverted=false} },
  -- ... etc for all 8 views
}

Camera Transitions

All camera changes use core_jobsystem.create for frame-accurate transitions:

local function setCameraRotationInJob(job)
  commands.setGameCamera()
  core_camera.setByName(0, "orbit", false)
  job.sleep(0.00001) -- wait one frame for orbit cam init
  core_camera.setDefaultRotation(be:getPlayerVehicleID(0), job.args[1])
  core_camera.resetCamera(0)
end

Layer-Based Camera

Positions camera using layer metadata for decal editing:

M.setCameraByLayer = function(layer)
  core_camera.setByName(0, 'free')
  core_camera.setDistance(0, veh:getViewportFillingCameraDistance() * 1.05)
  core_camera.setFOV(0, 45)
  core_camera.setPosition(0, layer.camPosition + veh:getPosition())
  core_camera.setRotation(0, quatFromDir(layer.camDirection))
end

Directional Switching

switchOrthographicViewByDirection(x, y) cycles through side views (right → front → left → back) with X input, and toggles top variants with Y input.


How It Works

  1. User selects a view → setOrthographicView("front") is called
  2. A job sets the orbit camera rotation to the predefined vector
  3. For layer editing, setCameraByLayer uses free camera with layer's position/direction
  4. getCoordinates() maps screen input to world axes for the current view
  5. Directional input cycles through views for quick navigation

Additional Exports

The following exports are available but not yet documented in detail:

  • M.getCoordinates
  • M.getCoordinatesByView
  • M.getOrthographicView
  • M.getOrthographicViewByPosition
  • M.getViewPointByLayer
  • M.orthographicViews
  • M.setOrthographicView
  • M.setOrthographicViewByPosition
  • M.setOrthographicViewLayer
  • M.switchOrthographicViewByDirection
  • M.switchToOrbit

Translate Helper

Translation utility with caching and nested translation pattern resolution.

Livery Editor - Controls

Action map management for the livery editor - handles input mode switching between transform, rotate, scale, and stamp modes.

On this page

OverviewExports (M)InternalsOrthographic ViewsCoordinate MappingCamera TransitionsLayer-Based CameraDirectional SwitchingHow It WorksAdditional Exports