API ReferenceGE ExtensionseditorvehicleEditorliveEditor
Vehicle Editor - Scene View
Creates and manages multiple auxiliary scene views (render views) attached to the vehicle, supporting orthographic projections (left/right/front/back/top/bottom) and free 3D camera mode.
Creates and manages multiple auxiliary scene views (render views) attached to the vehicle, supporting orthographic projections (left/right/front/back/top/bottom) and free 3D camera mode.
Module Exports
| Export | Type | Description |
|---|---|---|
M.addSceneView | function | Creates or shows a scene view window |
M.onEditorGui | hook | Renders all scene view windows |
M.onEditorHeadlessChange | hook | Initializes/unloads views on editor mode change |
M.onEditorInitialized | hook | Loads saved view configurations |
Key Internals
| Variable | Type | Purpose |
|---|---|---|
sceneViews | table | All scene view data, indexed by ID |
renderMain | BoolPtr | Toggle for main scene rendering |
editorInit | boolean | Prevents double initialization |
Per-View Data
| Field | Type | Purpose |
|---|---|---|
mode | string | '3d', 'left', 'right', 'front', 'back', 'top', 'bottom' |
pos | vec3 | Camera position |
rot | quat | Camera rotation |
fov | FloatPtr | Field of view |
nearClip / farClip | FloatPtr | Clipping planes |
ortho | BoolPtr | Orthographic projection toggle |
attachToObject | BoolPtr | Lock camera to player vehicle |
editorIconsVisible | BoolPtr | Show editor icons in view |
dragOffset | vec3 | User pan offset |
control | RenderViewControl | ImGui render view control object |
How It Works
- Views are created via
ImguiRenderViewControl.getOrCreate()and rendered as ImGui images - Each orthographic mode sets camera position relative to the focused vehicle with grid overlay
- Mouse dragging pans the view; scroll wheel zooms (adjusts FOV in ortho, moves camera in 3D)
- Settings are persisted via World Editor preferences (
vehicleEditor.veView.sceneViews) - Right-click context menu allows mode switching, clip/FOV adjustment, and view management
Lua Code Example
-- Add a new scene view
extensions.editor_vehicleEditor_liveEditor_veView.addSceneView()
-- Views support 7 modes: 3d, left, right, front, back, top, bottom
-- Orthographic views automatically:
-- - Set nearClip=0.6, farClip=100, fov=150
-- - Position camera at fixed offset from vehicle
-- - Draw a reference grid via _drawgrid()
-- 3D mode uses the main camera position/rotation:
-- view.pos = core_camera.getPosition()
-- view.rot = core_camera.getQuat()
-- Orthographic modes track the focused vehicle:
-- focusObj = getPlayerVehicle(0)
-- focusRot = quat(focusObj:getRefNodeRotation())
-- focusPos = focusObj:getPosition() + focusRot * view.dragOffset
-- Grid is drawn with 0.25m spacing, colored lines every 1m and 2m:
-- _drawgrid(gridSize=5, rot, gridOrigin, width=0.5)
-- Render view construction:
-- view.control = ImguiRenderViewControl.getOrCreate(wndName)
-- view.control.renderView.cameraMatrix = mat
-- view.control.renderView.resolution = Point2I(w, h)
-- view.control.renderView.frustum = Frustum.construct(ortho, fov, aspect, near, far)
-- view.control:draw()
-- Context menu (right-click) supports:
-- - Mode switching (3D, Left, Right, Front, Back, Top, Bottom)
-- - Ortho toggle with auto clip/fov adjustment
-- - Render Main toggle (setRenderWorldMain)
-- - Attach to Object toggle
-- - Near/Far clip and FOV sliders
-- - Add/Delete view
-- Settings saved to World Editor preferences:
-- editor.setPreference("vehicleEditor.veView.sceneViews", viewsSerialized)See Also
- Adjustable Tech Car Tuner - Related reference
- Aero Debug - Related reference
- Crash Tester - Related reference
- World Editor Guide - Guide
Vehicle Editor - Vehicle Spawner
Tool for spawning and despawning multiple vehicles at specified positions within the Vehicle Editor, with interactive location picking via raycast.
Vehicle Editor - JBeam Beautifier
Reformats JBeam files by aligning table columns within selected sections (nodes, beams, triangles, etc.) using AST-level manipulation, with optional number rounding.