Camera Mode: Manual Zoom
Filter camera mode providing manual FOV zoom control via player input (zoom in/out bindings). Displays a UI notification when FOV changes.
Filter camera mode providing manual FOV zoom control via player input (zoom in/out bindings). Displays a UI notification when FOV changes.
Overview
A hidden filter that reads MoveManager.zoomIn / MoveManager.zoomOut inputs and adjusts the camera's field of view accordingly. Used by other camera modes (onboard, relative, etc.) as a composable zoom component via require.
Class Properties
| Property | Type | Default | Description |
|---|---|---|---|
isFilter | bool | true | Post-processes other camera output |
hidden | bool | true | Not selectable by the user |
fovDefault | number | 80 | Default field of view (degrees) |
fovMin | number | 10 | Minimum allowed FOV |
fovMax | number | 120 | Maximum allowed FOV |
uiTxt | string | "ui.camera.fov" | Localization key for FOV notification |
fov | number | fovDefault | Current FOV value |
Methods
| Method | Signature | Description |
|---|---|---|
init | C:init(fovDefault, fovMin, fovMax, uiTxt) | Configure zoom range and defaults |
reset | C:reset() | Reset FOV to default |
update | C:update(data) | Process zoom input and apply FOV |
Usage as Component
-- Other camera modes use manualzoom as a composable filter
local manualzoom = require('core/cameraModes/manualzoom')
function C:init()
self.manualzoom = manualzoom()
self.manualzoom:init(self.fov) -- pass default FOV
end
function C:update(data)
self.manualzoom:update(data) -- updates data.res.fov
endZoom Calculation
-- FOV delta scales with current FOV for consistent zoom feel
local fovDelta = 4.5 * data.dt * (MoveManager.zoomIn - MoveManager.zoomOut) * self.fov
local fov = clamp(self.fov + fovDelta, self.fovMin, self.fovMax)
data.res.fov = fovKey Notes
- Disabled during OpenXR/VR sessions (returns immediately)
- FOV change speed scales with current FOV - zoom feels consistent at any level
- Shows
ui_messagenotification when FOV changes by ≥0.1 degrees - Returns
trueonly when notification was displayed (FOV visibly changed)
See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
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.
Camera Mode: Noise
Simple random noise filter that adds small positional jitter to the camera. Creates a subtle handheld or vibration effect.