API ReferenceGE Extensionseditor
Vehicle Detail Viewer
Multi-view orthographic vehicle renderer - creates configurable render views (left, right, front, back, top, bottom) with zoom, pan, near-clip control, and PNG export.
Multi-view orthographic vehicle renderer - creates configurable render views (left, right, front, back, top, bottom) with zoom, pan, near-clip control, and PNG export.
Module: M (extensions.editor.vehicleDetailViewer)
| Function | Description |
|---|---|
M.onEditorInitialized() | Registers menu item under Vehicles group |
M.onPreRender(dtReal, dtSim, dtRaw) | Creates/updates RenderViews, handles input, draws view windows |
M.onVehicleSpawned(vehicleId) | Recreates views when a new vehicle is spawned |
M.onSerialize() / M.onDeserialized(data) | Persists/restores view layout and settings |
M.onExtensionLoaded() | Refreshes available layout files |
M.onExtensionUnloaded() | Destroys all RenderViews |
View Properties
| Property | Type | Description |
|---|---|---|
typeName | string | View direction: Left, Right, Front, Back, Top, Bottom |
axis | int | Signed axis index (±1, ±2, ±3) |
zoom | float | Zoom level (1.0 = fit, smaller = zoom in) |
nearClip | float | Near clipping plane distance |
dragOffset | {x, y} | Pan offset in metres |
size | {x, y} | View resolution in pixels |
freeze | bool | Freeze camera updates |
debug | bool | Draw debug frustum |
fixUpAxis | bool | Use world up axis instead of vehicle up |
Usage Example
-- Open via F11 > Window > Experimental > Vehicle Detail Viewer
-- Or: F11 > Vehicles > Vehicle Detail Viewer
-- Each view window shows an orthographic projection of the vehicle:
-- * Left-click drag to pan
-- * Mouse wheel to zoom
-- * Shift + mouse wheel to adjust near clip
-- * Double-click to reset view
-- * Right-click for context menu:
-- - Switch view direction (Left/Right/Top/Bottom/Front/Back)
-- - Save as PNG (high resolution)
-- - Debug frustum toggle
-- - World up axis toggle
-- - Freeze camera toggle
-- - Layout save/load/delete
-- Resolution multiplier (1-3x) scales the render target
-- Layouts are saved to /settings/vehicleDetails/*.vehicleDetailSetting.json
-- Programmatic activation:
extensions.editor_vehicleDetailViewer -- loads on demand
-- The viewer creates RenderView objects via RenderViewManagerInstance
-- Each view renders only the player vehicle (focus object mode)
-- Views use orthographic frustum with configurable bounds
-- Near/far clipping is 0.1m to 10m by default
-- PNG export saves the render target to disk:
-- {viewName}-{layoutName}.png
-- Saved at the configured resolution × multiplierSee Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Vehicle Bridge Test
Simple debug tool for testing the vehicle bridge - sends key-value requests to a vehicle's Lua VM and displays the response.
Vehicle Editor Main
Main entry point for the Vehicle Editor - manages static/live editor modes, headless editor activation, extension loading, menu creation, and vehicle data management.