C# Class BetterBurnTime.ImpactTracker

Inheritance: UnityEngine.MonoBehaviour
Mostra file Open project: KSPSnark/BetterBurnTime Class Usage Examples

Private Properties

Property Type Description
AsInteger int
CalculateTimeToImpact double
CalculateVesselHeight double
ChooseParts List
GetVesselHeight double
Recalculate bool
Reset void

Public Methods

Method Description
LateUpdate ( ) : void

Called on each frame.

Start ( ) : void

Here when the add-on loads upon flight start.

Private Methods

Method Description
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

Method Details

LateUpdate() public method

Called on each frame.
public LateUpdate ( ) : void
return void

Start() public method

Here when the add-on loads upon flight start.
public Start ( ) : void
return void