NWH Aerodynamics
Search Results for

    Show / Hide Table of Contents

    Class AircraftController

    Primary controller for aircraft physics simulation, managing aerodynamic forces, flight dynamics, and aircraft systems including engines, control surfaces, and flight instruments.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    Vehicle
    AircraftController
    Inherited Members
    Vehicle.INPUT_DEADZONE
    Vehicle.SPEED_DEADZONE
    Vehicle.SMALL_NUMBER
    Vehicle.KINDA_SMALL_NUMBER
    Vehicle.ActiveVehicles
    Vehicle.onActiveVehicleChanged
    Vehicle.isPlayerControllable
    Vehicle.vehicleRigidbody
    Vehicle.vehicleTransform
    Vehicle.onCameraEnterVehicle
    Vehicle.onCameraExitVehicle
    Vehicle.onDisable
    Vehicle.onEnable
    Vehicle.onMultiplayerStatusChanged
    Vehicle.localAcceleration
    Vehicle.localForwardAcceleration
    Vehicle.localForwardVelocity
    Vehicle.localVelocity
    Vehicle.Awake()
    Vehicle.OnEnable()
    Vehicle.OnDisable()
    Vehicle.ActiveVehicle
    Vehicle.CameraInsideVehicle
    Vehicle.MultiplayerIsRemote
    Vehicle.Speed
    Vehicle.SpeedSigned
    Vehicle.Velocity
    Vehicle.VelocityMagnitude
    Vehicle.AngularVelocity
    Vehicle.AngularVelocityMagnitude
    Namespace: NWH.Aerodynamics.AircraftController
    Assembly: NWH.Aerodynamics.dll
    Syntax
    [DisallowMultipleComponent]
    [Serializable]
    [RequireComponent(typeof(VariableCenterOfMass))]
    [RequireComponent(typeof(AircraftInputManager))]
    [RequireComponent(typeof(Rigidbody))]
    public class AircraftController : Vehicle
    Remarks

    The AircraftController provides comprehensive aircraft simulation with realistic aerodynamics based on airfoil theory and flight physics. It manages all aspects of aircraft behavior including lift generation, drag calculation, control surface effectiveness, and propulsion systems.

    Key features include: - Realistic aerodynamic force calculation using airfoil sections and finite wing theory - Multiple control surface types: ailerons, elevators, rudders with proper effectiveness curves - Engine simulation supporting both piston and turbine engines with propeller/jet propulsion - Landing gear system with ground contact detection and gear retraction/extension - Flight instrument integration for airspeed, altitude, attitude, and navigation displays - Fuel system with multiple tanks and consumption modeling - Environmental effects including wind, atmosphere density variation with altitude

    The aircraft uses a component-based architecture where aerodynamic surfaces, engines, and systems are modular components that can be configured independently. The center of mass automatically adjusts based on fuel consumption and payload changes to maintain realistic flight characteristics.

    Requires proper setup of Rigidbody mass and inertia tensor for realistic flight behavior. Use the Aircraft Setup Wizard for automated configuration of common aircraft types.

    Fields

    | Edit this page View Source

    DefaultResourcesPath

    Path for the NWH Aerodynamics defaults. Relative to the Resources directory.

    Declaration
    public const string DefaultResourcesPath = "NWH Aerodynamics/Defaults/"
    Field Value
    Type Description
    string
    | Edit this page View Source

    OnCollision

    Triggered on collision.

    Declaration
    [Tooltip("Triggered on collision.")]
    public AircraftController.CollisionEvent OnCollision
    Field Value
    Type Description
    AircraftController.CollisionEvent

    Properties

    | Edit this page View Source

    Airspeed

    Current airspeed of the aircraft in meters per second (m/s). Represents the speed of the aircraft relative to the surrounding air mass.

    Declaration
    public float Airspeed { get; }
    Property Value
    Type Description
    float
    Remarks

    Airspeed differs from ground speed when wind is present. It's the critical parameter for aerodynamic calculations as lift and drag forces depend on airspeed, not ground speed.

    Typical airspeeds: - Stall speed: 15-25 m/s (30-50 kts) for light aircraft - Cruise speed: 50-100 m/s (100-200 kts) for general aviation - Commercial aircraft: 125-250 m/s (250-500 kts)

    | Edit this page View Source

    AirspeedKTS

    Airspeed in [KTS].

    Declaration
    public float AirspeedKTS { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    AngleOfAttack

    Current angle of attack in degrees - the angle between the aircraft's longitudinal axis and the relative airflow. Critical parameter for lift generation and stall behavior.

    Declaration
    public float AngleOfAttack { get; }
    Property Value
    Type Description
    float
    Remarks

    Angle of attack directly controls lift production. Higher angles generate more lift up to the stall point, beyond which lift decreases rapidly and drag increases significantly.

    Typical ranges: - Normal flight: 2-8 degrees - Maximum lift: 12-16 degrees (varies by airfoil) - Stall angle: 16-20 degrees for most aircraft - Post-stall: Above stall angle, reduced lift and increased drag

    | Edit this page View Source

    Elevation

    Aircraft elevation in [m]. If FloatingOrigin is present this value will differ from transform.position.y.

    Declaration
    public float Elevation { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    ElevationFt

    Aircraft elevation in [ft].

    Declaration
    public float ElevationFt { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    GlideRatio

    Glide ratio (ratio of vertical vs. horizontal speed).

    Declaration
    public float GlideRatio { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Heading

    Compass heading in [deg].

    Declaration
    public float Heading { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    LandingGearTouchingGround

    True if any of the landing gear is touching ground.

    Declaration
    public bool LandingGearTouchingGround { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Pitch

    Aircraft pitch in [deg].

    Declaration
    public float Pitch { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    RateOfClimb

    Rate of climb in [m/s].

    Declaration
    public float RateOfClimb { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    RateOfClimbFtMin

    Rate of climb in [ft/min]

    Declaration
    public float RateOfClimbFtMin { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Roll

    Aircraft roll in [deg].

    Declaration
    public float Roll { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Yaw

    Aircraft yaw in [deg].

    Declaration
    public float Yaw { get; }
    Property Value
    Type Description
    float

    Methods

    | Edit this page View Source

    FixedUpdate()

    Declaration
    public override void FixedUpdate()
    Overrides
    NWH.Common.Vehicles.Vehicle.FixedUpdate()
    | Edit this page View Source

    OnDrawGizmosSelected()

    Declaration
    public void OnDrawGizmosSelected()
    | Edit this page View Source

    Start()

    Declaration
    public void Start()
    | Edit this page View Source

    UpdateFlightData()

    Updates Airspeed, RateOfClimb and other flight data.

    Declaration
    public void UpdateFlightData()

    See Also

    Airfoil
    ControlSurface
    AircraftEngineBase
    LandingGear()
    AircraftInputManager
    Vehicle
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics