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
Editor Element HelperPlot Helper UtilitySearch UtilityTransform UtilityVehicle Filter UtilityVehicle Select UtilityZone Selector Utility

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 Extensionseditorutil

Transform Utility

Reusable position/rotation/scale editor widget with axis gizmo integration, helper buttons (down-to-terrain, focus, move-to-camera, align-with-terrain), and shift+click quick placement.

Reusable position/rotation/scale editor widget with axis gizmo integration, helper buttons (down-to-terrain, focus, move-to-camera, align-with-terrain), and shift+click quick placement.


Class: C (returned by factory function)

Core Methods

MethodSignatureDescription
C:init(editName, objectName)-Creates a unique edit mode, input fields, and default transform
C:set(pos, rot, scl)All optionalSets position/rotation/scale; nil params are ignored
C:setOneDimensionalScale(ods)boolToggles between single float and vec3 scale
C:start()-Activates the associated edit mode
C:stop()-Deactivates the edit mode if currently active
C:update(mouseInfo)-Full update: gizmo + widget + shift-drag quick edit; returns changed
C:enableEditing(cooldown)cooldown: int (default 1)Activates edit mode with brief input cooldown
C:combinedWidget()-Renders edit/done button + helper buttons + pos/rot/scl inputs
C:widget()-Renders basic pos/rot/scl input fields
C:widgetCondensed()-Compact version with "Pos"/"Rot"/"Scl" labels
C:gizmo()-Renders edit/exit button and manages axis gizmo
C:contextMenu()-Renders right-click context menu with position/rotation helpers

Helper Actions

MethodDescription
C:helperFocus()Smoothly focuses camera on the transform position
C:helperPositionToCamera()Sets position to current camera position
C:helperPositionInFrontOfToCamera()Places 15m in front of camera
C:helperPositionDownToTerrain()Drops position to terrain height
C:helperRotationToCamera()Sets rotation to match camera
C:helperRotateWithCamera()Rotates to face away from camera
C:helperAlignWithTerrain()Aligns rotation with terrain normal
C:helperMoveToTransform()Teleports player vehicle to the transform
C:helperCameraToPosition()Moves free camera to the position
C:helperCameraToRotation()Sets free camera rotation
C:helperCameraToPositionRotation()Moves and rotates free camera

Dragging

MethodDescription
C:beginDrag()Stores pre-drag state
C:dragging()Applies gizmo translation/rotation/scale; draws debug axes
C:endDragging()Marks drag complete
C:resetDragging()Clears stored drag state
C:shiftUpdate(mouseInfo)Handles shift+click-drag quick placement on terrain

State

MethodDescription
C:correctEditMode()Returns true if this transform's edit mode is active
C:updateTransform()Syncs the gizmo MatrixF from current pos/rot
C:updateInputFields()Syncs ImGui input pointers from current pos/rot/scl
C:getValidButtons()Returns helper buttons filtered by allowTranslate/allowRotate
C:onActivate()Clears object selection on edit mode activate
C:onDeactivate()Clears object selection on edit mode deactivate

Usage Example

local transformUtil = require('/lua/ge/extensions/editor/util/transformUtil')

-- Create a transform helper
local tr = transformUtil("Spawn Point", "Spawn")
tr.allowTranslate = true
tr.allowRotate = true
tr.allowScale = false

-- Set initial position
tr:set(vec3(100, 200, 50), quatFromDir(vec3(0, 1, 0), vec3(0, 0, 1)))

-- In editor GUI update loop:
local mouseInfo = {
  camPos = core_camera.getPosition(),
  ray = getCameraMouseRay(),
  rayCast = cameraMouseRayCast(),
  valid = true,
  down = im.IsMouseClicked(0),
  hold = im.IsMouseDown(0),
  up = im.IsMouseReleased(0),
}

if tr:update(mouseInfo) then
  -- Transform was changed
  local pos = tr.pos
  local rot = tr.rot
  log("I", "", string.format("New pos: %.1f, %.1f, %.1f", pos.x, pos.y, pos.z))
end

-- Or use the simpler gizmo-only mode:
if tr:gizmo() then
  -- Transform changed via gizmo
end

-- Quick placement: hold Shift and click-drag on terrain
-- The position snaps to click point, rotation follows drag direction
-- Scale is set by drag distance (if one-dimensional scale enabled)

See Also

  • Editor Element Helper - Related reference
  • Plot Helper Utility - Related reference
  • Search Utility - Related reference
  • World Editor Guide - Guide

Search Utility

Fuzzy text search utility with scoring, frecency-based result ranking, and a searchable ImGui combo box widget.

Vehicle Filter Utility

Vehicle filter editor for missions/quests - provides a UI for base filters (whitelist/blacklist), probability-weighted sub-filters, manual additions/removals, and vehicle selection using configListGen

On this page

Class: C (returned by factory function)Core MethodsHelper ActionsDraggingStateUsage ExampleSee Also