C# Class FreeFlightPhysics, Unity-Free-Flight

Simulate the flow of air around an airfoil. This class applies passive forces on a flight object, such as lift and drag. It only applies these forces based on the current state of the wing, but never changes the actual wing itself (so no flapping).
Inheritance: FlightObject
Afficher le fichier Open project: NickolausDS/Unity-Free-Flight Class Usage Examples

Méthodes publiques

Свойство Type Description
dragEnabled bool
gravityEnabled bool
liftEnabled bool

Protected Properties

Свойство Type Description
rigidbody UnityEngine.Rigidbody

Méthodes publiques

Méthode Description
FreeFlightPhysics ( Rigidbody rb ) : System.Collections
doStandardPhysics ( ) : void

Apply the regular flight physics to the flight object. Precondition: This must be called at regular intervals to have a smooth effect on the physics object (use FixedUpdate).

getAngleOfAttack ( Quaternion theCurrentRotation, Vector3 theCurrentVelocity ) : float
getBankedTurnRotation ( Quaternion theCurrentRotation ) : Quaternion
getDirectionalVelocity ( Quaternion theCurrentRotation, Vector3 theCurrentVelocity ) : Vector3
getDrag ( float velocity, float pressure, float area, float dragCoff, float lift, float aspectR ) : float

Get the current drag force on the object based on the parameters. All dimensions must be in metric.

getDragCoefficient ( float angleDegrees ) : float
getLift ( float velocity, float pressure, float area, float liftCoff ) : float

Get the current lift force on the object based on the paramaters. All dimensions must be in metric.

getLiftCoefficient ( float angleDegrees ) : float
getStallRotation ( Quaternion curRot, float velocity ) : Quaternion

Method Details

FreeFlightPhysics() public méthode

public FreeFlightPhysics ( Rigidbody rb ) : System.Collections
rb UnityEngine.Rigidbody
Résultat System.Collections

doStandardPhysics() public méthode

Apply the regular flight physics to the flight object. Precondition: This must be called at regular intervals to have a smooth effect on the physics object (use FixedUpdate).
public doStandardPhysics ( ) : void
Résultat void

getAngleOfAttack() public méthode

public getAngleOfAttack ( Quaternion theCurrentRotation, Vector3 theCurrentVelocity ) : float
theCurrentRotation Quaternion
theCurrentVelocity Vector3
Résultat float

getBankedTurnRotation() public méthode

public getBankedTurnRotation ( Quaternion theCurrentRotation ) : Quaternion
theCurrentRotation Quaternion
Résultat Quaternion

getDirectionalVelocity() public méthode

public getDirectionalVelocity ( Quaternion theCurrentRotation, Vector3 theCurrentVelocity ) : Vector3
theCurrentRotation Quaternion
theCurrentVelocity Vector3
Résultat Vector3

getDrag() public méthode

Get the current drag force on the object based on the parameters. All dimensions must be in metric.
public getDrag ( float velocity, float pressure, float area, float dragCoff, float lift, float aspectR ) : float
velocity float Velocity Meters/Second
pressure float Pressure (something)
area float Area Meters^2
dragCoff float Drag coff (dimensionless)
lift float Lift Newtons
aspectR float Aspect r. (dimensionless)
Résultat float

getDragCoefficient() public méthode

public getDragCoefficient ( float angleDegrees ) : float
angleDegrees float
Résultat float

getLift() public méthode

Get the current lift force on the object based on the paramaters. All dimensions must be in metric.
public getLift ( float velocity, float pressure, float area, float liftCoff ) : float
velocity float Velocity Meters/Second
pressure float Pressure (something)
area float Area Meters^2
liftCoff float Lift coff. (dimensionless)
Résultat float

getLiftCoefficient() public méthode

public getLiftCoefficient ( float angleDegrees ) : float
angleDegrees float
Résultat float

getStallRotation() public méthode

public getStallRotation ( Quaternion curRot, float velocity ) : Quaternion
curRot Quaternion
velocity float
Résultat Quaternion

Property Details

dragEnabled public_oe property

public bool dragEnabled
Résultat bool

gravityEnabled public_oe property

public bool gravityEnabled
Résultat bool

liftEnabled public_oe property

public bool liftEnabled
Résultat bool

rigidbody protected_oe property

protected Rigidbody,UnityEngine rigidbody
Résultat UnityEngine.Rigidbody