Rally Camera Path Player
Plays a cinematic camera path along a snaproad for rally stage preview. Generates a Catmull-Rom camera path from driveline points with configurable height offset, FOV, and playback speed.
Plays a cinematic camera path along a snaproad for rally stage preview. Generates a Catmull-Rom camera path from driveline points with configurable height offset, FOV, and playback speed.
Constructor
local CameraPathPlayer = require('/lua/ge/extensions/gameplay/rally/cameraPathPlayer')
local player = CameraPathPlayer(snaproad)Public API
| Method | Signature | Returns | Description |
|---|---|---|---|
init | (snaproad) | nil | Stores the snaproad reference |
play | () | nil | Generates and plays a camera path from the snaproad |
stop | () | nil | Stops the current camera path |
Internals
Default Parameters
| Parameter | Value | Description |
|---|---|---|
metersBefore | 40 | Meters of path before the current point |
metersAfter | 20 | Meters of path after the current point |
heightOffset | 2 | Camera height above the path in meters |
fov | 70 | Field of view in degrees |
playbackRateKph | 80 | Camera movement speed in km/h |
Path Generation (loadPath)
The internal loadPath function converts snaproad points into a core_paths-compatible camera path:
- Iterates through points, calculating accumulated distance between them
- Converts distance to time using the playback rate (m/s)
- Creates marker objects with position (elevated by height offset), rotation, FOV, and time
- Builds a path JSON structure with rotation fix-up (quaternion dot product sign correction)
- Applies default spline smoothing (0.5) to markers
How It Works
play()fetches points from the snaproad for a window around the current position- Points are converted to camera markers with height offset and calculated timing
- The path is passed to
core_paths.playPath()for Catmull-Rom spline interpolation stop()callscore_paths.stopCurrentPath()to end playback
Usage Examples
-- Create and play a camera preview
local camPlayer = CameraPathPlayer(mySnaproad)
camPlayer:play()
-- Later, stop the preview
camPlayer:stop()Notes
- Uses irregular point spacing: timing is based on accumulated distance rather than fixed intervals
- Camera path format matches core_paths version 6 with
rotFixIdrotation correction - The
trackPositionfield is set tofalse- camera follows the spline, not a vehicle - Playback rate is converted from km/h to m/s internally
See Also
- Rally Audio Manager - Related reference
- Rally Client - Related reference
- Rally Cut Capture - Related reference
- Gameplay Systems Guide - Guide
Rally Audio Manager
Manages a queue of pacenote audio playback and pauses for the rally co-driver system. Handles sequential playback with breath timing between notes and damage interruption.
Rally Client
HTTP client for communicating with a local rally companion server. Sends recording cut commands and retrieves transcription results via REST API on `localhost:27872`.