Camera Mode: Path
Global camera that follows a spline path defined by markers. Uses Catmull-Rom interpolation for smooth position and rotation along timed control points. Supports replay synchronization, manual FOV, bu
Global camera that follows a spline path defined by markers. Uses Catmull-Rom interpolation for smooth position and rotation along timed control points. Supports replay synchronization, manual FOV, bullet-time, looping, and vehicle tracking.
Overview
The path camera flies through a series of markers using Catmull-Rom spline interpolation. Each marker defines position, rotation, FOV, and timing. Supports two data formats: legacy pathName-based (via core_paths) and JSON-based (via customData). Used for cutscenes, camera path editor previews, and replay camera paths.
Class Properties
| Property | Type | Default | Description |
|---|---|---|---|
isGlobal | bool | true | Available without a vehicle |
hidden | bool | true | Not in user camera cycle |
ctrlPoint | number | 0 | Current control point index |
camT | number | 0 | Current time along the path |
customData | table | nil | External path data controller |
path | table | nil | JSON path object (markers array) |
pathName | string | nil | Legacy path name for core_paths |
fovOffset | number | 0 | Manual FOV zoom offset |
Methods
| Method | Signature | Description |
|---|---|---|
init | C:init() | Reset all path state |
update | C:update(data) | Advance time, interpolate, apply |
setCustomData | C:setCustomData(data) | Set path data controller |
reset | C:reset() | Reset path playback |
getTimeToNext | C:getTimeToNext(path, index) | Time between markers |
getGlobalTime | C:getGlobalTime(path, index, looped) | Absolute time at marker |
Catmull-Rom Interpolation
-- Position interpolation using chordal Catmull-Rom
local tNorm = calculateTnorm(d12, d23, d34, t1, t2, t3, camTLocal)
local pos = catmullRomChordal(p1, p2, p3, p4, tNorm, positionSmooth)
-- Rotation interpolation using centripetal Catmull-Rom
local rot = catmullRomCentripetal(r1, r2, r3, r4, tNorm):normalized()
-- FOV interpolation using monotonic Steffen
local fov = monotonicSteffen(fov1, fov2, fov3, fov4, 0, t1, t1+t2, t1+t2+t3, t1+camTLocal)Vehicle Tracking
-- Markers with trackPosition=true aim at the vehicle
if markers[n2].trackPosition then
r2 = quatFromDir(target - pos, vec3(0,0,1)) -- look at vehicle
end
-- Optional tracking offset from camPathEditor
local trackingOffset = extensions.editor_camPathEditor.getTrackingOffset()
target = target + right * trackingOffset.x + forward * trackingOffset.y + up * trackingOffset.zCustom Data Interface
-- customData object must provide:
customData:getNextPath() -- returns next path or pathName
customData:finishedPath() -- called when path ends
customData:onNextControlPoint(idx, total) -- called at each marker
customData:reset() -- called on camera reset
customData.useJsonVersion -- bool: JSON vs legacy mode
customData.useDtReal -- bool: use real dt instead of sim dt
customData.offset -- number: initial time offsetMarker Properties
| Field | Type | Description |
|---|---|---|
pos | vec3 | World position |
rot | quat | Camera rotation |
fov | number | Field of view (default 60) |
time | number | Time to next marker (legacy) or absolute time (JSON) |
trackPosition | bool | Aim at vehicle instead of using fixed rotation |
cut | bool | Hard cut (skip interpolation) |
movingStart | bool | Virtual start marker for smooth entry |
movingEnd | bool | Virtual end marker for smooth exit |
nearClip | number | Optional near clip distance |
positionSmooth | number | Position smoothing parameter |
bullettime | number | Replay speed at this marker |
Key Notes
- Uses
data.dtSimby default (respects time scaling);useDtRealoverrides - Replay mode syncs
camTtocore_replay.getPositionSeconds() - Manual FOV mode allows zoom in/out with clamped
fovOffsetin[-1, 1] - Rotation quaternion signs are fixed for consistent interpolation
- Path loops by resetting
ctrlPointandcamTwhen reaching the end
See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
Camera Mode: Pacenote Orbit
Global orbit camera for the pacenote/rally editor. Orbits a fixed world-space target point with mouse/keyboard rotation, zoom, and terrain collision avoidance.
Camera Mode: Predictor
Filter that shifts the camera's look-at target ahead of the vehicle based on velocity. Creates a forward-looking effect that anticipates the vehicle's movement.