C# Класс 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()
Наследование: FreeFlightPhysics
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
currentFlapTime float
isFlapping bool

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
getAOAForZeroLCOF ( ) : float

Описание методов

CreatureFlightPhysics() публичный Метод

public CreatureFlightPhysics ( Rigidbody rb ) : System.Collections
rb UnityEngine.Rigidbody
Результат System.Collections

directionalInput() публичный Метод

public directionalInput ( float bank, float pitch, float sensitivity ) : void
bank float
pitch float
sensitivity float
Результат void

execute() публичный Метод

public execute ( CreatureFlightPhysics controller ) : void
controller CreatureFlightPhysics
Результат void

flap() публичный Метод

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.
Результат void

thrust() публичный Метод

public thrust ( float forceNewtons ) : void
forceNewtons float
Результат void

wingFold() публичный Метод

public wingFold ( float left, float right ) : void
left float
right float
Результат void

Описание свойств

currentFlapTime защищенное свойство

protected float currentFlapTime
Результат float

isFlapping защищенное свойство

protected bool isFlapping
Результат bool