NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Flip Over Module

    FlipOver module inspector.

    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:

    1. Vehicle angle exceeds Allowed Angle threshold (default: 70 degrees)
    2. Linear velocity is below Max Detection Speed (default: 0.6 m/s)
    3. Angular velocity is below Max Detection Speed
    4. 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
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics