KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
TimeWarp Class Reference

The class that handles time warp. More...

Inheritance diagram for TimeWarp:

Public Types

enum  Modes { Modes.HIGH = 0, Modes.LOW = 1 }
 

Public Member Functions

 TimeWarp ()
 
double GetAltitudeLimit (int i, CelestialBody body)
 Presumably, gets the minimum altitude in meters above the sea level of the given body at which the given warp rate index is allowed. More...
 

Static Public Member Functions

static void SetRate (int rate_index, bool instant)
 Changes the warp rate to either warpRates[rateIndex] or physicsWarpRates[rate_index], depending on whether WarpMode is HIGH or LOW. More...
 

Public Attributes

float[] altitudeLimits
 Unused? CelestialBodies have their own sets of altitude limits. More...
 
int current_rate_index
 
int maxModeSwitchRate_index
 
int maxPhysicsRate_index
 
TimeWarp.Modes Mode
 
float[] physicsWarpRates
 The available physics warp rates. In 0.18.2 these are {1, 2, 3, 4} by default. You can modify the available rates by modifying this array. More...
 
GUIStyle screenTextStyle
 
float textDuration
 
ScreenSafeUISlideTab timeQuadrantTab
 
ScreenSafeUISliderButton warpHighButton
 
ScreenSafeUISliderButton warpLowButton
 
float[] warpRates
 The available regular warp rates. In 0.18.2 these are {1, 5, 10, 50, 100, 1000, 10000, 100000} by default. You can modify the available rates by modifying this array. More...
 

Static Public Attributes

static TimeWarp fetch
 Use this TimeWarp instance to access non-static members. More...
 

Properties

static float CurrentRate [get]
 The current warp rate, e.g. 50 if the current warp rate is 50x. This number may not be equal to one of the entries in warpRates, because KSP will smoothly interpolate between two warp rates over a period of time when you increase or decrease the warp. More...
 
static int CurrentRateIndex [get]
 The index of the current current warp rate in either warpRates or physicsWarpRates, depending on whether WarpMode is HIGH or LOW. Note that CurrentRate may not equal the warp rate indexed by CurrentRateIndex if KSP has not finished interpolating the last warp change. More...
 
static float deltaTime [get]
 
static float fixedDeltaTime [get]
 The time between FixedUpdate cycles (i.e., the time between physics steps). See the Unity FixedUpdate documentation for more details. More...
 
static float MaxPhysicsRate [get]
 
static TimeWarp.Modes WarpMode [get]
 Whether we are in regular warp mode or physics warp mode More...
 

Detailed Description

The class that handles time warp.

Member Enumeration Documentation

Enumerator
HIGH 

Reguar time warp mode

LOW 

Physics warp mode

Constructor & Destructor Documentation

TimeWarp.TimeWarp ( )

Member Function Documentation

double TimeWarp.GetAltitudeLimit ( int  i,
CelestialBody  body 
)

Presumably, gets the minimum altitude in meters above the sea level of the given body at which the given warp rate index is allowed.

Parameters
iA warp rate index
bodyThe body in question
Returns
The minimum altitude in meters at which that warp rate index is allowed
static void TimeWarp.SetRate ( int  rate_index,
bool  instant 
)
static

Changes the warp rate to either warpRates[rateIndex] or physicsWarpRates[rate_index], depending on whether WarpMode is HIGH or LOW.

Parameters
rate_indexThe index of the desired new warp rate
instantIf false, KSP will gradually smoothly adjust the warp rate up or down until it reaches the target. If true, the warp rate will change instantly.

Member Data Documentation

float [] TimeWarp.altitudeLimits

Unused? CelestialBodies have their own sets of altitude limits.

int TimeWarp.current_rate_index
TimeWarp TimeWarp.fetch
static

Use this TimeWarp instance to access non-static members.

int TimeWarp.maxModeSwitchRate_index
int TimeWarp.maxPhysicsRate_index
TimeWarp.Modes TimeWarp.Mode
float [] TimeWarp.physicsWarpRates

The available physics warp rates. In 0.18.2 these are {1, 2, 3, 4} by default. You can modify the available rates by modifying this array.

GUIStyle TimeWarp.screenTextStyle
float TimeWarp.textDuration
ScreenSafeUISlideTab TimeWarp.timeQuadrantTab
ScreenSafeUISliderButton TimeWarp.warpHighButton
ScreenSafeUISliderButton TimeWarp.warpLowButton
float [] TimeWarp.warpRates

The available regular warp rates. In 0.18.2 these are {1, 5, 10, 50, 100, 1000, 10000, 100000} by default. You can modify the available rates by modifying this array.

Property Documentation

float TimeWarp.CurrentRate
staticget

The current warp rate, e.g. 50 if the current warp rate is 50x. This number may not be equal to one of the entries in warpRates, because KSP will smoothly interpolate between two warp rates over a period of time when you increase or decrease the warp.

int TimeWarp.CurrentRateIndex
staticget

The index of the current current warp rate in either warpRates or physicsWarpRates, depending on whether WarpMode is HIGH or LOW. Note that CurrentRate may not equal the warp rate indexed by CurrentRateIndex if KSP has not finished interpolating the last warp change.

float TimeWarp.deltaTime
staticget
float TimeWarp.fixedDeltaTime
staticget

The time between FixedUpdate cycles (i.e., the time between physics steps). See the Unity FixedUpdate documentation for more details.

float TimeWarp.MaxPhysicsRate
staticget
TimeWarp.Modes TimeWarp.WarpMode
staticget

Whether we are in regular warp mode or physics warp mode


The documentation for this class was generated from the following file: