Class PropulsorBase
Base class for all thrust-generating propulsors (propellers, jets, etc.). Converts engine power/torque into thrust force applied to the aircraft.
Inheritance
Namespace: NWH.Aerodynamics.AircraftController.Propulsion.Propulsors
Assembly: NWH.Aerodynamics.dll
Syntax
public abstract class PropulsorBase : MonoBehaviour
Fields
| Edit this page View SourceV0
Freestream velocity through the propulsor in m/s.
Declaration
public float V0
Field Value
| Type | Description |
|---|---|
| float |
_atmosphere
Declaration
protected Atmosphere _atmosphere
Field Value
| Type | Description |
|---|---|
| Atmosphere |
_inputManager
Declaration
protected AircraftInputManager _inputManager
Field Value
| Type | Description |
|---|---|
| AircraftInputManager |
_targetRigidbody
Declaration
protected Rigidbody _targetRigidbody
Field Value
| Type | Description |
|---|---|
| Rigidbody |
angularVelocity
Current angular velocity of the propulsor in radians per second.
Declaration
public float angularVelocity
Field Value
| Type | Description |
|---|---|
| float |
efficiency
Current propulsive efficiency (0 to 1). Ratio of thrust power to shaft power.
Declaration
public float efficiency
Field Value
| Type | Description |
|---|---|
| float |
gearRatio
Gear ratio between engine and propulsor. Values greater than 1 reduce propulsor RPM, values less than 1 increase it.
Declaration
public float gearRatio
Field Value
| Type | Description |
|---|---|
| float |
inertia
Rotational inertia of the propulsor in kg*m^2. Affects how quickly the propulsor spools up or down.
Declaration
public float inertia
Field Value
| Type | Description |
|---|---|
| float |
propulsivePower
Propulsive power output in kilowatts (thrust * velocity).
Declaration
public float propulsivePower
Field Value
| Type | Description |
|---|---|
| float |
radius
Effective radius of the propulsor in meters. Used for thrust and torque calculations.
Declaration
public float radius
Field Value
| Type | Description |
|---|---|
| float |
reverseThrustCoefficient
Amount of thrust when propeller is rotating in opposite direction.
Declaration
[Tooltip("Amount of thrust when propeller is rotating in opposite direction.")]
public float reverseThrustCoefficient
Field Value
| Type | Description |
|---|---|
| float |
rotationDirection
Direction of propeller rotation. Affects animation only.
Declaration
[Tooltip("Direction of propeller rotation. Affects animation only.")]
public PropulsorBase.RotationDirection rotationDirection
Field Value
| Type | Description |
|---|---|
| PropulsorBase.RotationDirection |
shaftTorque
Torque reaction on the propulsor shaft in Newton-meters. Transmitted back to the engine.
Declaration
public float shaftTorque
Field Value
| Type | Description |
|---|---|
| float |
thrust
Current thrust force generated in Newtons.
Declaration
public float thrust
Field Value
| Type | Description |
|---|---|
| float |
thrustDirection
Direction in which the thrust will be applied in local coordinates.
Declaration
[Tooltip("Direction in which the thrust will be applied in local coordinates.")]
public Vector3 thrustDirection
Field Value
| Type | Description |
|---|---|
| Vector3 |
thrustPoint
Point at which the thrust will be applied in local coordinates.
Declaration
[Tooltip("Point at which the thrust will be applied in local coordinates.")]
public Vector3 thrustPoint
Field Value
| Type | Description |
|---|---|
| Vector3 |
Properties
| Edit this page View SourceThrustDirection
Gets the thrust direction in world space coordinates.
Declaration
public Vector3 ThrustDirection { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
ThrustPoint
Gets the thrust application point in world space coordinates.
Declaration
public Vector3 ThrustPoint { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Methods
| Edit this page View SourceApplyThrust(float)
Applies the calculated thrust force to the aircraft rigidbody.
Declaration
public virtual void ApplyThrust(float thrust)
Parameters
| Type | Name | Description |
|---|---|---|
| float | thrust | Thrust force in Newtons to apply. |
Awake()
Declaration
public virtual void Awake()
FixedUpdate()
Declaration
public virtual void FixedUpdate()
GetZAngleDelta()
Calculates the angular rotation delta for visual animation.
Declaration
public virtual float GetZAngleDelta()
Returns
| Type | Description |
|---|---|
| float | Rotation angle delta in degrees for this frame. |
OnDrawGizmosSelected()
Declaration
public virtual void OnDrawGizmosSelected()
Step(float, float, float, float, Atmosphere, out float, out float)
Simulates the propulsor for one physics step. Calculates thrust and torque based on angular velocity, freestream velocity, and atmospheric conditions.
Declaration
public virtual void Step(float inAngVel, float maxAngVel, float inV0, float inTorque, Atmosphere atmosphere, out float thrustOut, out float torqueOut)
Parameters
| Type | Name | Description |
|---|---|---|
| float | inAngVel | Input angular velocity in rad/s. |
| float | maxAngVel | Maximum angular velocity in rad/s. |
| float | inV0 | Freestream velocity in m/s. |
| float | inTorque | Input torque from engine in N*m. |
| Atmosphere | atmosphere | Atmospheric conditions for air density. |
| float | thrustOut | Output thrust force in Newtons. |
| float | torqueOut | Output reaction torque in N*m. |
UpdateVisual()
Declaration
public virtual void UpdateVisual()