NWH Aerodynamics
Search Results for

    Show / Hide Table of Contents

    Class AircraftFuelTank

    Represents a fuel tank that stores fuel and affects aircraft center of mass and total weight. Position in the aircraft hierarchy should match the physical fuel tank location.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    AircraftFuelTank
    Implements
    IMassAffector
    Namespace: NWH.Aerodynamics.AircraftController.Fuel
    Assembly: NWH.Aerodynamics.dll
    Syntax
    public class AircraftFuelTank : MonoBehaviour, IMassAffector
    Remarks

    Implements IMassAffector to integrate with the VariableCenterOfMass system. As fuel is consumed, the tank's mass decreases (assuming 0.8 kg/liter fuel density), shifting the aircraft's CG and affecting flight characteristics. Tank position influences moment arms for pitch/roll behavior changes during fuel burn.

    Fields

    | Edit this page View Source

    capacity

    Maximum fuel storage capacity of this tank (in liters). Cannot be exceeded when refueling.

    Declaration
    [SerializeField]
    [Tooltip("Fuel capacity in liters.")]
    public float capacity
    Field Value
    Type Description
    float

    Properties

    | Edit this page View Source

    Amount

    Gets or sets current fuel amount (in liters). Cannot be negative. Consumed by AircraftFuelManager based on engine demands.

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

    Capacity

    Gets or sets the maximum tank capacity (in liters). Cannot be negative.

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

    FuelPercentage

    Current fuel level as a percentage of capacity (0-1 range). Use for fuel gauge displays and warnings.

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

    HasFuel

    Returns true if tank contains any fuel.

    Declaration
    public bool HasFuel { get; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    GetMass()

    Calculates current fuel mass in kilograms using 0.8 kg/liter density (typical for aviation fuel). Used by VariableCenterOfMass system for dynamic weight distribution.

    Declaration
    public float GetMass()
    Returns
    Type Description
    float

    Fuel mass in kilograms

    | Edit this page View Source

    GetTransform()

    Returns the Transform component for IMassAffector position tracking.

    Declaration
    public Transform GetTransform()
    Returns
    Type Description
    Transform
    | Edit this page View Source

    GetWorldCenterOfMass()

    Returns the world-space position of the fuel tank's center of mass for IMassAffector integration.

    Declaration
    public Vector3 GetWorldCenterOfMass()
    Returns
    Type Description
    Vector3

    Implements

    NWH.Common.CoM.IMassAffector
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics