C# Класс BetterBurnTime.ImpactTracker

Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AsInteger int
CalculateTimeToImpact double
CalculateVesselHeight double
ChooseParts List
GetVesselHeight double
Recalculate bool
Reset void

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

Метод Описание
LateUpdate ( ) : void

Called on each frame.

Start ( ) : void

Here when the add-on loads upon flight start.

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

Метод Описание
AsInteger ( double value ) : int
CalculateTimeToImpact ( Vessel vessel, string &verb, double &impactSpeed ) : double

Gets the time in seconds until the vessel will impact the surface. Returns positive infinity if it's not applicable.

CalculateVesselHeight ( Vessel vessel, Part &lowestPart ) : double

This method calculates the height in meters from the ship's "current point" to its lowest extent. Subtracting this number from vessel.altitude gives the altitude of the bottom of the ship, in the ship's current orientation. Thank you to SirDiazo's mod Landing Height for code that inspired this section. Landing Height: https://kerbalstuff.com/mod/458/Landing%20Height It's notable that this code is somewhat simplified from SirDiazo's because it's solving a simpler problem (i.e. it's saving computation by giving more of an approximation). This is a moderately expensive calculation to perform, so use sparingly (i.e. not on every frame).

ChooseParts ( Vessel vessel ) : List
GetVesselHeight ( Part &currentLowestPart ) : double
Recalculate ( ) : bool

Do necessary calculations around impact tracking. Returns true if there's anything to display.

Reset ( ) : void

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

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

Called on each frame.
public LateUpdate ( ) : void
Результат void

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

Here when the add-on loads upon flight start.
public Start ( ) : void
Результат void