Camera Mode: Autozoom
Filter camera that automatically adjusts FOV based on distance to target. Uses discrete zoom steps with smooth transitions, plus user zoom override via numpad 9/3.
Filter camera that automatically adjusts FOV based on distance to target. Uses discrete zoom steps with smooth transitions, plus user zoom override via numpad 9/3.
Class API
| Method | Signature | Description |
|---|---|---|
C:init | (smoother) | Initializes zoom steps and FOV smoother |
C:getFov | (distance, dt) | Computes smoothed FOV for a given distance |
C:reset | () | Resets user FOV offset to zero |
C:update | (data) | Sets data.res.fov based on target distance |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
isFilter | boolean | true | Modifies existing camera output |
fov | number | 60 | Last rendered FOV |
baseFov | number | 90 | FOV chosen by distance steps |
userFov | number | 0 | User zoom delta (numpad 9/3) |
Default Zoom Steps
| Distance (m) | FOV (°) |
|---|---|
| 0 | 120 |
| 1.5 | 100 |
| 3 | 70 |
| 8 | 50 |
| 20 | 20 |
| 50 | 10 |
| 125 | 4 |
| 200 | 2 |
The FOV transitions smoothly between steps using a TemporalSpring smoother. After a reset (e.g. camera switch), the first FOV is set instantly without smoothing.
Usage Examples
-- Created internally by external/fan cameras
local autozoom = require('core/cameraModes/autozoom')()
-- Custom zoom steps for a specific use case
autozoom.steps = {
{0, 70}, {3, 50}, {10, 30}, {50, 15}
}
-- Reset user zoom override
autozoom:reset()See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Big Map - Related reference
- Camera Mode: Chase - Related reference
- Core Systems Guide - Guide
Camera Mode: Autopoint
Filter camera that smoothly adjusts the camera's look-at target to a local offset on the vehicle. Used by external/fan cameras to track specific vehicle nodes.
Camera Mode: Big Map
Top-down camera for the big map overview. Supports mouse drag panning, scroll zoom with cursor anchoring, WASD movement, and map boundary clamping.