API ReferenceGE ExtensionscorecameraModes
Camera Mode: Crash
Cinematic crash camera with multiple viewpoints. Supports cockpit POV from the second vehicle, overhead close-up, and stationary observer positions.
Cinematic crash camera with multiple viewpoints. Supports cockpit POV from the second vehicle, overhead close-up, and stationary observer positions.
Class API
| Method | Signature | Description |
|---|---|---|
C:init | () | Sets default mode (1), hidden |
C:setCustomData | (data) | Configures crash camera mode and vehicle references |
C:update | (data) | Renders the selected camera viewpoint |
Custom Data Fields
| Field | Type | Description |
|---|---|---|
veh1Id | number | Primary crash vehicle ID |
veh2Id | number | Secondary crash vehicle ID (optional) |
camMode | number | 1 = close overhead, 2 = stationary observer |
hitPoint | vec3 | Crash impact point |
camOffset | vec3 | Camera offset from hit point (mode 1) |
Camera Modes
Mode 1: Close Overhead
- Camera positioned at
hitPoint + camOffset - Looks directly at the crash point
- FOV: 50°
Mode 2: Stationary Observer
- Camera placed at a random clear ground position within 20m
- Uses raycast validation (10m+ distance, line-of-sight clear)
- FOV: random 20-25°
- Falls back after 40 recursive attempts
Cockpit View
- When
veh2Idis provided and random chance passes - Uses driver node of veh2, looking at veh1's bounding box center
- FOV: 40°
- Automatically exits cockpit when the two vehicles' bounding boxes intersect
Usage Examples
-- Set crash camera (called by crash detection system)
core_camera.setGlobalCameraByName("crash", false, {
veh1Id = crashVeh1:getId(),
veh2Id = crashVeh2:getId(),
camMode = 2,
hitPoint = impactPos,
camOffset = vec3(0, 0, 3)
})See Also
- Camera Mode: Autopoint - Related reference
- Camera Mode: Autozoom - Related reference
- Camera Mode: Big Map - Related reference
- Core Systems Guide - Guide
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.
Camera Mode: Driver
First-person driver camera with physics-based head movement, seat adjustment, look-ahead, horizon stabilization, VR support, and per-vehicle saved configurations.