Vehicle Editor - Static Render View
Manages multiple independent render views for the static vehicle editor, with 3D/orthographic modes, axis gizmo navigation, grid overlays, and WASD camera control.
Manages multiple independent render views for the static vehicle editor, with 3D/orthographic modes, axis gizmo navigation, grid overlays, and WASD camera control.
Module Exports
| Export | Type | Description |
|---|---|---|
M.createRenderViewUI | function | Creates or shows a render view window |
M.getMainRenderViewMouseRay | function | Returns unprojected ray from hovered render view |
M.destroyAllRenderViews | function | Destroys all render view objects |
M.onPreRender | hook | Draws grids and axis gizmos per render view |
M.onEditorGui | hook | Renders all render view windows |
M.onEditorHeadlessChange | hook | Saves settings and cleans up on editor exit |
M.onEditorInitialized | hook | Loads saved render view configurations |
M.onSerialize | hook | Saves settings to disk |
M.onDeserialize | hook | (empty) |
M.moveLeft | function | Camera left movement (keybinding) |
M.moveRight | function | Camera right movement (keybinding) |
M.moveForward | function | Camera forward movement (keybinding) |
M.moveBackward | function | Camera backward movement (keybinding) |
M.setCameraSpeed | function | Camera speed multiplier (keybinding) |
Key Internals
| Variable | Type | Purpose |
|---|---|---|
wndsData | table | Per-window render view data |
hoveredWndID | number | ID of currently hovered window (-1 if none) |
focusedWndID | number | ID of currently focused window (-1 if none) |
settingsPath | string | "settings/vehicleEditorStatic/staticRenderView.json" |
View Modes
| Constant | Value | Description |
|---|---|---|
VIEW_MODE_3D | 1 | Free perspective camera |
VIEW_MODE_LEFT | 2 | Orthographic -X view |
VIEW_MODE_RIGHT | 3 | Orthographic +X view |
VIEW_MODE_BACK | 4 | Orthographic -Y view |
VIEW_MODE_FRONT | 5 | Orthographic +Y view |
VIEW_MODE_BOTTOM | 6 | Orthographic -Z view |
VIEW_MODE_TOP | 7 | Orthographic +Z view |
Per-Window Data
Each window contains a main render view and an axis gizmo render view:
- Main RV: full scene with configurable camera, clip planes, FOV, ortho mode
- Axis gizmo RV: small overlay showing clickable axis arrows for quick mode switching
How It Works
Render Views
- Created via
RenderViewManagerInstance:getOrCreateView()with named texture targets - Camera matrix constructed from
pos+rotquaternion - Frustum built with
Frustum.construct(ortho, fov, aspect, near, far) - Images displayed via
imUtils.texObj(textureName)andim.Image()
Axis Gizmo
- Renders 6 colored axis arrows (±X, ±Y, ±Z) in a small overlay
- Arrow picking via
closestLinePoints()ray-line intersection - Clicking an arrow switches to the corresponding orthographic view mode
- Arrows fade when aligned with the view direction
Camera Control
- WASD movement via keybinding exports
- Middle mouse drag rotates in 3D mode, pans in ortho mode
- Scroll wheel zooms (FOV in ortho, position in 3D)
- Fast speed multiplier via shift key
Grid
- Drawn at origin with configurable size (10m) and block size (0.25m)
- Red/green axis lines at center, gray grid lines elsewhere
Lua Code Example
-- Create a new render view
extensions.editor_vehicleEditor_staticEditor_veStaticRenderView.createRenderViewUI()
-- Get mouse ray from hovered render view (for node/beam picking):
-- local res, pos, dir = getMainRenderViewMouseRay()
-- View mode switching:
-- _enterViewMode(wndID, VIEW_MODE_TOP)
-- Sets ortho=true, nearClip=0.6, farClip=100, fov=150
-- Positions camera at offset from origin
-- Render view setup:
-- local rv = RenderViewManagerInstance:getOrCreateView(name)
-- rv.namedTexTargetColor = name
-- rv.cameraMatrix = mat
-- rv.resolution = Point2I(w, h)
-- rv.frustum = Frustum.construct(ortho, fov, aspect, near, far)
-- Camera movement (called from keybindings):
-- M.moveForward(1) -- start moving
-- M.moveForward(0) -- stop moving
-- M.setCameraSpeed(s) -- 0..1 maps to 1x..2.5x speed
-- Settings persisted to JSON:
-- jsonWriteFile(settingsPath, viewsSerialized, true)
-- Context menu (right-click) provides:
-- Mode submenu, Near/Far/FOV sliders, Add/Delete viewSee Also
- Vehicle Editor - JBeam Beautifier - Related reference
- Vehicle Editor - JBeam Modifier Leaking Visualizer - Related reference
- Vehicle Editor - JBeam Spellchecker - Related reference
- World Editor Guide - Guide
Vehicle Editor - Part Tree
Hierarchical tree view of JBeam part data with interactive 3D node/beam picking, selection, visibility toggling, and integration with the AST text view.
Flowgraph Base Module
Base class factory for flowgraph modules. Modules are manager-level components that provide shared state and services to flowgraph nodes (e.g., button management, camera paths, file I/O).