C# Class CreatureFlightPhysics, Unity-Free-Flight

Flight Mechanics is responsible for converting user input into manipulating the wing for various physics effects. It handles the math behind flapping, flarring, and diving to change how physics effects the flight object. It does NOT directly interact with the user, ever. Instead, it's intended that the main free flight script pass in all user input, and call methods from here through Fixed Update()
Inheritance: FreeFlightPhysics
Afficher le fichier Open project: NickolausDS/Unity-Free-Flight Class Usage Examples

Protected Properties

Свойство Type Description
currentFlapTime float
isFlapping bool

Méthodes publiques

Méthode Description
CreatureFlightPhysics ( Rigidbody rb ) : System.Collections
directionalInput ( float bank, float pitch, float sensitivity ) : void
execute ( CreatureFlightPhysics controller ) : void
flap ( float minFlapTime, float regFlapTime, float flapStrength, float downBeatStrength, bool regFlap, bool quickFlap ) : void

Try to execute a flap. A regular flap can only happen in regular intervals determined by regFlapTime. A quickFlap is faster, and can happen in minFlapTime intervals or regular flaptime intervals. If we are not flapping, and the wings are open, we are guaranteed a flap.

thrust ( float forceNewtons ) : void
wingFold ( float left, float right ) : void

Private Methods

Méthode Description
getAOAForZeroLCOF ( ) : float

Method Details

CreatureFlightPhysics() public méthode

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

directionalInput() public méthode

public directionalInput ( float bank, float pitch, float sensitivity ) : void
bank float
pitch float
sensitivity float
Résultat void

execute() public méthode

public execute ( CreatureFlightPhysics controller ) : void
controller CreatureFlightPhysics
Résultat void

flap() public méthode

Try to execute a flap. A regular flap can only happen in regular intervals determined by regFlapTime. A quickFlap is faster, and can happen in minFlapTime intervals or regular flaptime intervals. If we are not flapping, and the wings are open, we are guaranteed a flap.
public flap ( float minFlapTime, float regFlapTime, float flapStrength, float downBeatStrength, bool regFlap, bool quickFlap ) : void
minFlapTime float Minimum flap time.
regFlapTime float Reg flap time.
flapStrength float Flap strength.
downBeatStrength float
regFlap bool
quickFlap bool If set to true quick flap.
Résultat void

thrust() public méthode

public thrust ( float forceNewtons ) : void
forceNewtons float
Résultat void

wingFold() public méthode

public wingFold ( float left, float right ) : void
left float
right float
Résultat void

Property Details

currentFlapTime protected_oe property

protected float currentFlapTime
Résultat float

isFlapping protected_oe property

protected bool isFlapping
Résultat bool