Camera Mode: Chase
Third-person chase camera that follows vehicle direction with automatic forward/backward switching. Features smoothed direction tracking, configurable roll smoothing, and collision detection.
Third-person chase camera that follows vehicle direction with automatic forward/backward switching. Features smoothed direction tracking, configurable roll smoothing, and collision detection.
Class API
| Method | Signature | Description |
|---|---|---|
C:init | () | Initializes smoothers, collision, settings |
C:onVehicleCameraConfigChanged | () | Applies jBeam camera config (distance, FOV, offset) |
C:onSettingsChanged | () | Reads relaxation and roll smoothing settings |
C:reset | () | Resets rotation to defaults, clears input |
C:update | (data) | Computes chase position with direction smoothing |
C:setRefNodes | (center, left, back) | Sets vehicle reference nodes |
C:mouseLocked | (locked) | Clears relative input on mouse unlock |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
disabledByDefault | boolean | true | Not in default camera rotation |
distance | number | 5 | Default follow distance |
camMinDist | number | 3 | Minimum zoom distance |
fov | number | 65 | Field of view |
mode | string | "ref" | Target mode: "ref" or "center" |
offset | vec3 | varies | Camera target offset |
defaultRotation | vec3 | (0, -17, 0) | Default pitch angle |
Direction Switching
The camera auto-detects driving direction:
- Switches to rear view when forward velocity drops below -1.5 m/s and dominates lateral velocity
- Switches back to forward view when velocity exceeds +1.5 m/s
- Camera rotation is smoothed to prevent jarring transitions
Input Handling
- Yaw input (relative + buttons) triggers 90° side views or 180° rear view
- Pitch input adjusts elevation angle
- Zoom switches between min distance, default distance, and 2x distance
- Uses deadzone (0.5) to prevent jittery small inputs
Usage Examples
-- Switch to chase camera
core_camera.setByName(0, "chase")
-- Chase cam is collision-aware
-- data.res.collisionCompatible = trueNotes
- Roll smoothing is controlled by
cameraChaseRollSmoothingsetting - Direction smoothing uses
TemporalSmoothing(0.0008)for very gradual direction changes - Collision filter is applied after position calculation
See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
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.
Camera Mode: Collision
Filter camera that prevents the camera from clipping through walls and terrain. Uses raycasting from target to camera with near-clip plane corner checks.