Flip Over Module

Automatic vehicle recovery module that detects and corrects vehicle rollovers.
Overview
The FlipOverModule monitors the vehicle's orientation and initiates recovery when the vehicle is inverted beyond the configured angle threshold. Recovery only happens when the vehicle is genuinely stuck (low velocity, stable orientation).
Recovery Modes
Flip Over Type:
- Instant: Immediately reorients the vehicle to upright position with a vertical offset. Best for arcade-style gameplay.
- Gradual: Smoothly rotates the vehicle over several seconds using physics-based torque. More realistic and immersive.
Flip Over Activation:
- Manual: Requires player input (default: 'T' key) to initiate recovery after timeout.
- Automatic: Recovery begins automatically after the timeout period when flipped.
Detection Criteria
Recovery is only initiated when all conditions are met:
- Vehicle angle exceeds
Allowed Anglethreshold (default: 70 degrees) - Linear velocity is below
Max Detection Speed(default: 0.6 m/s) - Angular velocity is below
Max Detection Speed - Timeout period has elapsed (default: 1 second)
Properties
| Property | Description |
|---|---|
Allowed Angle |
Minimum angle from upright (degrees) to trigger flip detection. Lower values detect earlier but may false-positive during extreme maneuvers. Recommended: 70-80 degrees for balanced detection |
Timeout |
Detection check interval and automatic activation delay (seconds). Prevents premature activation and gives players time to self-recover |
Max Detection Speed |
Maximum velocity threshold (m/s) for both linear and angular velocity. Prevents unrealistic mid-air corrections |
Flip Over Duration |
Duration of gradual flip animation in seconds (only applies to Gradual type). Default: 5 seconds |
Instant Flip Over Vertical Offset |
Vertical offset (meters) applied during instant recovery to prevent ground clipping. Set based on vehicle height (default: 1m for standard cars) |
Flipped Over |
Read-only state indicating if vehicle is currently detected as flipped. Useful for UI prompts or external systems |