NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class AirSteerModule

    Provides aerial control for vehicles when airborne.

    Inheritance
    object
    VehicleComponent
    AirSteerModule
    Inherited Members
    VehicleComponent.state
    VehicleComponent.vehicleController
    VehicleComponent.IsActive
    VehicleComponent.VC_Initialize(VehicleController)
    VehicleComponent.VC_Initialize()
    VehicleComponent.VC_SetDefaults()
    VehicleComponent.VC_LoadStateFromStateSettings()
    VehicleComponent.VC_Update(float)
    VehicleComponent.VC_Enable(bool)
    VehicleComponent.VC_Disable(bool)
    VehicleComponent.VC_DrawGizmos()
    VehicleComponent.VC_Validate(VehicleController)
    VehicleComponent.UpdateLOD()
    VehicleComponent.ToggleState()
    Namespace: NWH.VehiclePhysics2.Modules.AirSteer
    Assembly: NWH.VehiclePhysics2.dll
    Syntax
    [Serializable]
    public class AirSteerModule : VehicleComponent
    Remarks

    The AirSteerModule allows the vehicle to adjust its orientation while in the air using steering and throttle/brake inputs. This creates more engaging gameplay during jumps and prevents uncontrolled tumbling when airborne.

    How It Works: The module applies torque around the vehicle's local axes based on player input: - Steering input controls yaw (rotation around Y axis) for left/right orientation - Throttle input controls pitch downward (nose down, rotation around X axis) - Brake input controls pitch upward (nose up, rotation around X axis)

    The module only activates when the vehicle has no wheels in contact with the ground, ensuring it doesn't interfere with normal driving physics.

    Use Cases: - Stunt/arcade racing games where mid-air control is desired - Off-road vehicles that frequently become airborne over jumps - Rally and motocross games - Preventing uncontrolled tumbling during high-speed accidents - Allowing players to land properly after ramps

    Balancing: Higher torque values provide more responsive control but may feel unrealistic. Lower values require more skill and planning for aerial maneuvers. Adjust based on your game's desired realism level and target audience.

    Note: Wheel angular momentum effects (gyroscopic effects from spinning wheels) are applied independently by the WheelController and work in addition to this module's torques.

    Fields

    pitchTorque

    Torque applied around the vehicle's local X axis for pitch control (nose up/down).

    Declaration
    [Tooltip("Torque applied around the X axis to steer the vehicle while in the air (nose up, down).\r\nActivated with throttle / brake input.\r\nTorque from the changes in the wheel angular velocity will get applied independently of this setting\r\nby the WheelController.")]
    public float pitchTorque
    Field Value
    Type Description
    float
    Remarks

    Controlled by throttle (nose down) and brake (nose up) inputs while airborne. Throttle applies forward torque rotating the nose down, while brake applies backward torque rotating the nose up.

    Typical values by game style: - Simulation/realistic: 5000-10000 Nm - Balanced/semi-arcade: 10000-20000 Nm (default: 10000 Nm) - Arcade/stunt: 20000-50000 Nm

    Vehicle mass affects effectiveness - heavier vehicles need higher torque values for similar responsiveness. Scale this value proportionally to vehicle mass: torque = baseTorque * (vehicleMass / 1500kg)

    Higher values allow: - Quicker orientation corrections - More control over landing angle - Easier stunt execution

    Lower values require: - More planning before jumps - Better timing and skill - More realistic aerial behavior

    Set to 0 to disable pitch control while keeping yaw control active.

    yawTorque

    Torque applied around the vehicle's local Y axis for yaw control (nose left/right).

    Declaration
    [Tooltip("Torque applied around the Y axis to steer the vehicle while in the air (nose left/right).\r\nActivated with steering input.")]
    public float yawTorque
    Field Value
    Type Description
    float
    Remarks

    Controlled by steering input while airborne. Positive steering (right) applies positive torque rotating the nose right, negative steering (left) applies negative torque.

    Typical values by game style: - Simulation/realistic: 5000-10000 Nm - Balanced/semi-arcade: 10000-20000 Nm (default: 10000 Nm) - Arcade/stunt: 20000-50000 Nm

    Like pitch torque, effectiveness depends on vehicle mass. Heavier vehicles need proportionally higher torque for similar responsiveness.

    Higher values allow: - Quicker direction changes mid-air - Easier alignment for landing - More arcade-style aerial control

    Lower values provide: - More realistic flight dynamics - Greater challenge for aerial maneuvers - Less forgiving but more rewarding control

    Set to 0 to disable aerial steering while keeping pitch control active.

    Methods

    VC_FixedUpdate(float)

    Physics update called at fixed intervals. Override to implement physics-based behavior.

    Declaration
    public override void VC_FixedUpdate(float DeltaTime)
    Parameters
    Type Name Description
    float DeltaTime

    Time elapsed since last FixedUpdate in seconds

    Overrides
    VehicleComponent.VC_FixedUpdate(float)
    Remarks

    Only called when the component is active (initialized and enabled). Use for physics calculations, force application, and other fixed-timestep operations. Called from VehicleController.FixedUpdate().

    See Also

    ModuleManager
    VehicleController
    WheelComponent
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics