Camera Mode: Smooth
Spring-based position smoothing filter. Applies temporal spring smoothing independently to each axis of the camera position to reduce jitter and sudden jumps.
Spring-based position smoothing filter. Applies temporal spring smoothing independently to each axis of the camera position to reduce jitter and sudden jumps.
Overview
A hidden filter that wraps newTemporalSpring smoothers around the camera position. Each axis (X, Y, Z) is smoothed independently with configurable spring stiffness and damping. Used to soften position output from other camera modes.
Class Properties
| Property | Type | Default | Description |
|---|---|---|---|
isFilter | bool | true | Post-processes other camera output |
hidden | bool | true | Not selectable by the user |
spring | number | 30 | Spring stiffness |
damp | number | 10 | Damping factor |
posX | TemporalSpring | - | X-axis spring smoother |
posY | TemporalSpring | - | Y-axis spring smoother |
posZ | TemporalSpring | - | Z-axis spring smoother |
Methods
| Method | Signature | Description |
|---|---|---|
init | C:init(spring, damp, pos) | Create springs, optionally set initial position |
update | C:update(data) | Apply spring smoothing to data.res.pos |
Spring Smoothing
-- Each axis smoothed independently via temporal spring
data.res.pos.x = self.posX:get(data.res.pos.x, data.dt)
data.res.pos.y = self.posY:get(data.res.pos.y, data.dt)
data.res.pos.z = self.posZ:get(data.res.pos.z, data.dt)Initial Position
-- Optional: seed springs with a known position to avoid snap
local smooth = require('core/cameraModes/smooth')
local smoother = smooth({spring = 30, damp = 10})
smoother:init(30, 10, vec3(100, 200, 50)) -- pre-set positionKey Notes
- Higher
spring= faster tracking, higherdamp= less oscillation - Only smooths position - rotation and FOV pass through unchanged
- Uses BeamNG's
newTemporalSpringengine function - Can be initialized with a starting position to prevent first-frame snap
See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
Camera Mode: Shake
Sinusoidal camera shake filter that adds continuous oscillating position and rotation offsets. Creates a smooth, rhythmic shake effect for cinematic or impact scenarios.
Camera Mode: Top Down
Example custom camera mode providing a top-down overhead view of the vehicle. Height and look-ahead scale with vehicle speed.