API ReferenceGE Extensionscore
Vehicle Mirrors
Renders vehicle mirror reflections by computing reflection camera transforms from mirror node positions and the player camera.
Renders vehicle mirror reflections by computing reflection camera transforms from mirror node positions and the player camera.
Public API
| Function | Signature | Description |
|---|---|---|
M.onPreRender | (dtReal, dtSim, dtRaw) | Per-frame hook - triggers mirror data request and renders reflections |
M.onVehicleSwitched | (oldVehId, newVehId) | Hook for vehicle switch (currently no-op) |
M.onVehicleMirrorsChanged | (id, data) | Callback receiving mirror config from vehicle data |
Internal Details
- Mirrors are defined by 3 node IDs (
id1,id2,id3) in vehicle data - Reflection direction is computed:
camMirrorDir - 2 * project(camMirrorDir, lookDir) - Renders to a texture target at 128×128, 70° FOV, 0.1–250m range
- Update rate is configurable (default 0.3s) with ImGui debug UI
- Adds
userCorrectionvec3 per mirror for manual adjustment
Usage Example
-- Mirrors are loaded automatically via the extension system.
-- Mirror data comes from vehicle's JBeam definition.
-- The extension renders reflections to named texture targets
-- which materials reference on the mirror mesh.Vehicle Bridge (GE ↔ VLua Communication)
Black-box communication layer between GE Lua and vehicle Lua (VLua). All gameplay-related VLua requests should go through this bridge via `gameplayInterface` on the vehicle side.
Vehicle Paints
Resolves, caches, and distributes vehicle paint data including paint libraries, paint collections, multi-paint setups, and random paint selection with weighted probability distributions.