Camera Mode: Game Engine
Final-stage camera filter that commits the computed camera state to the engine. Handles OpenXR/VR pose integration before pushing position, rotation, FOV, and near clip to the renderer.
Final-stage camera filter that commits the computed camera state to the engine. Handles OpenXR/VR pose integration before pushing position, rotation, FOV, and near clip to the renderer.
Overview
This is a global filter camera mode with runningOrder = 1, meaning it runs last in the camera pipeline. It takes the accumulated data.res from all prior camera modes/filters and calls setCameraPosRotFovNearClipC to apply it to the engine. When an OpenXR VR session is active, it integrates the predicted headset pose.
Class Properties
| Property | Type | Default | Description |
|---|---|---|---|
isGlobal | bool | true | Always active across all camera configurations |
runningOrder | number | 1 | Runs last in the camera pipeline |
isFilter | bool | true | Post-processes other camera output |
hidden | bool | true | Not selectable by the user |
Methods
| Method | Signature | Description |
|---|---|---|
init | C:init() | Sets global/filter/hidden flags and running order |
update | C:update(data) | Applies camera state to engine; integrates OpenXR if active |
Engine Integration
-- Final pipeline step: push camera to renderer
setCameraPosRotFovNearClipC(
data.res.pos.x, data.res.pos.y, data.res.pos.z,
data.res.rot.x, data.res.rot.y, data.res.rot.z, data.res.rot.w,
data.res.fov,
data.res.nearClip
)OpenXR VR Path
-- When VR headset is active, blend predicted pose
if data.openxrSessionRunning then
OpenXR.setGeluaCameraPosRot(pos, rot)
local posX, posY, posZ, rotX, rotY, rotZ, rotW = OpenXR.getCameraPosRotPredictedXYZXYZW()
data.res.pos:setAddXYZ(posX, posY, posZ)
data.res.rot:setMulXYZW(rotX, rotY, rotZ, rotW, ...)
endKey Notes
- Logs a warning if no level is loaded (
levelLoadedglobal is nil) - Uses
gameNotifiedflag to avoid spamming the warning - Must not be modified - final stage of camera pipeline
See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
Camera Mode: Free Camera
Detached free-fly camera with Newton physics for smooth movement. Supports keyboard/mouse/gamepad/3D spacemouse input, configurable smoothing, and manual zoom.
Camera Mode: Handheld
Spring-damper filter that adds handheld camera feel by smoothing the look direction with physical simulation. Creates a natural lag and sway effect on the camera's aim direction.