Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | Static Public Attributes | Properties | List of all members
SentinelMission.SentinelUtilities Class Reference

Static Public Member Functions

static double AdjustedSentinelViewAngle (Orbit innerOrbit, Orbit outerOrbit)
 Calculates the viewing angle offset created by a sentinel's distance from its focus body. More...
 
static float CalculateReadDuration (string s)
 Calculates how long a message of any length should display using average reading speeds. More...
 
static bool FindInnerAndOuterBodies (double SMA, out CelestialBody innerBody, out CelestialBody outerBody)
 Uses an arbitrary semi-major axis to determine the bodies on either side of it. More...
 
static bool FindInnerAndOuterBodies (Orbit o, out CelestialBody innerBody, out CelestialBody outerBody)
 Uses semi-major axis of an orbit to determine the bodies on either side of it. More...
 
static bool FindInnerAndOuterBodies (Vessel v, out CelestialBody innerBody, out CelestialBody outerBody)
 Uses semi-major axis of a vessel's orbit to determine the bodies on either side of it. More...
 
static double GetEscapeVelocity (CelestialBody body, double altitude)
 Calculates the velocity required to escape a body at a certain altitude. More...
 
static double GetMinimumOrbitalSpeed (CelestialBody body)
 Calculates the slowest velocity to possibly maintain while still in orbit of a body. More...
 
static double GetProgradeBurnAllowance (Orbit o)
 Calculates how much velocity a sentinel spawned asteroid has to work with in a prograde eccentricity burn. More...
 
static double GetRetrogradeBurnAllowance (Orbit o)
 Calculates how much velocity a sentinel spawned asteroid has to work with in a retrograde eccentricity burn. More...
 
static UntrackedObjectClass GetVesselClass (Vessel v)
 Gets the discovery object class of a vessel, loaded or not. More...
 
static bool IsOnSolarOrbit (CelestialBody body)
 Determines if a body is directly orbiting the sun. More...
 
static double RandomRange (System.Random generator=null, double min=double.MinValue, double max=double.MaxValue)
 Chooses a random unweighted number from min-max. More...
 
static SentinelScanType RandomScanType (System.Random generator=null)
 Picks a random scan type. More...
 
static bool SentinelCanScan (Vessel v, CelestialBody innerBody=null, CelestialBody outerBody=null)
 Determines if a vessel is properly aligned for sentinel scanning. More...
 
static UntrackedObjectClass WeightedAsteroidClass (System.Random generator=null)
 Chooses a random asteroid class, weighted towards larger classes. More...
 
static double WeightedRandom (System.Random generator)
 Chooses a random number from 0-1, weighted towards zero by WeightedStability. More...
 
static double WeightedRandom (System.Random generator, double min, double max)
 Chooses a random number from min-max, weighted towards min by WeightedStability. More...
 
static double WeightedRandom (System.Random generator, double max)
 Chooses a random number from 0-max, weighted towards 0 by WeightedStability. More...
 

Static Public Attributes

static double MaxAsteroidEccentricity = 0.4
 
static double MaxAsteroidInclination = 40
 
static double MinAsteroidEccentricity = 0.05
 
static double MinAsteroidInclination = 5
 
static int perSentinelObjectLimit = 10
 How many untracked objects each sentinel can track More...
 

Properties

static string SentinelModuleDisplayName [get, set]
 
static string SentinelModuleName [get, set]
 
static string SentinelPartDisplayName [get, set]
 
static string SentinelPartName [get, set]
 
static string SentinelPartTitle [get]
 
static double SentinelViewAngle [get, set]
 
static float SpawnChance [get, set]
 
static int WeightedStability [get, set]
 

Member Function Documentation

static double SentinelMission.SentinelUtilities.AdjustedSentinelViewAngle ( Orbit  innerOrbit,
Orbit  outerOrbit 
)
inlinestatic

Calculates the viewing angle offset created by a sentinel's distance from its focus body.

Parameters
innerOrbitThe sentinel's orbit.
outerOrbitThe focus body's orbit.
Returns
An offset viewing angle.
static float SentinelMission.SentinelUtilities.CalculateReadDuration ( string  s)
inlinestatic

Calculates how long a message of any length should display using average reading speeds.

Parameters
sThe string.
Returns
The average time (in seconds) it takes to read the string.
static bool SentinelMission.SentinelUtilities.FindInnerAndOuterBodies ( double  SMA,
out CelestialBody  innerBody,
out CelestialBody  outerBody 
)
inlinestatic

Uses an arbitrary semi-major axis to determine the bodies on either side of it.

Parameters
SMAThe semi-major axis.
innerBodyThe body to store the inner body in.
outerBodyThe body to store the outer body in.
Returns
False if the semi-major axis falls in a weird spot.
static bool SentinelMission.SentinelUtilities.FindInnerAndOuterBodies ( Orbit  o,
out CelestialBody  innerBody,
out CelestialBody  outerBody 
)
inlinestatic

Uses semi-major axis of an orbit to determine the bodies on either side of it.

Parameters
oThe orbit.
innerBodyThe body to store the inner body in.
outerBodyThe body to store the outer body in.
Returns
False if the semi-major axis falls in a weird spot.
static bool SentinelMission.SentinelUtilities.FindInnerAndOuterBodies ( Vessel  v,
out CelestialBody  innerBody,
out CelestialBody  outerBody 
)
inlinestatic

Uses semi-major axis of a vessel's orbit to determine the bodies on either side of it.

Parameters
vThe vessel.
innerBodyThe body to store the inner body in.
outerBodyThe body to store the outer body in.
Returns
False if the semi-major axis falls in a weird spot.
static double SentinelMission.SentinelUtilities.GetEscapeVelocity ( CelestialBody  body,
double  altitude 
)
inlinestatic

Calculates the velocity required to escape a body at a certain altitude.

Parameters
bodyThe body.
altitudeThe altitude.
Returns
The required velocity to escape the body.
static double SentinelMission.SentinelUtilities.GetMinimumOrbitalSpeed ( CelestialBody  body)
inlinestatic

Calculates the slowest velocity to possibly maintain while still in orbit of a body.

Parameters
bodyThe body.
Returns
The slowest velocity you can orbit the body at.
static double SentinelMission.SentinelUtilities.GetProgradeBurnAllowance ( Orbit  o)
inlinestatic

Calculates how much velocity a sentinel spawned asteroid has to work with in a prograde eccentricity burn.

Parameters
oThe asteroid's orbit.
Returns
The amount the asteroid can "burn" without escaping the sun.
static double SentinelMission.SentinelUtilities.GetRetrogradeBurnAllowance ( Orbit  o)
inlinestatic

Calculates how much velocity a sentinel spawned asteroid has to work with in a retrograde eccentricity burn.

Parameters
oThe asteroid's orbit.
Returns
The amount the asteroid can "burn" without diving into the sun.
static UntrackedObjectClass SentinelMission.SentinelUtilities.GetVesselClass ( Vessel  v)
inlinestatic

Gets the discovery object class of a vessel, loaded or not.

Parameters
vThe vessel.
Returns
The vessel's discovery class.
static bool SentinelMission.SentinelUtilities.IsOnSolarOrbit ( CelestialBody  body)
inlinestatic

Determines if a body is directly orbiting the sun.

Parameters
bodyThe CelestialBody.
Returns
If the CelestialBody is orbiting the sun.
static double SentinelMission.SentinelUtilities.RandomRange ( System.Random  generator = null,
double  min = double.MinValue,
double  max = double.MaxValue 
)
inlinestatic

Chooses a random unweighted number from min-max.

Parameters
generatorAn optional random generator.
minThe minimum generated value.
maxThe maximum generated value.
Returns
static SentinelScanType SentinelMission.SentinelUtilities.RandomScanType ( System.Random  generator = null)
inlinestatic

Picks a random scan type.

Parameters
generatorAn optional random generator.
Returns
A random scan type.
static bool SentinelMission.SentinelUtilities.SentinelCanScan ( Vessel  v,
CelestialBody  innerBody = null,
CelestialBody  outerBody = null 
)
inlinestatic

Determines if a vessel is properly aligned for sentinel scanning.

Parameters
vThe vessel.
innerBodyOptional inner body.
outerBodyOptional outer body.
Returns
If the vessel is properly aligned for sentinel scanning.
static UntrackedObjectClass SentinelMission.SentinelUtilities.WeightedAsteroidClass ( System.Random  generator = null)
inlinestatic

Chooses a random asteroid class, weighted towards larger classes.

Parameters
generatorAn optional random generator.
Returns
A random weighted asteroid class.
static double SentinelMission.SentinelUtilities.WeightedRandom ( System.Random  generator)
inlinestatic

Chooses a random number from 0-1, weighted towards zero by WeightedStability.

Parameters
generatorAn optional random generator.
Returns
A random number from 0-1.
static double SentinelMission.SentinelUtilities.WeightedRandom ( System.Random  generator,
double  min,
double  max 
)
inlinestatic

Chooses a random number from min-max, weighted towards min by WeightedStability.

Parameters
generatorAn optional random generator.
minThe minimum generated value.
maxThe maximum generated value.
Returns
A random number from min-max.
static double SentinelMission.SentinelUtilities.WeightedRandom ( System.Random  generator,
double  max 
)
inlinestatic

Chooses a random number from 0-max, weighted towards 0 by WeightedStability.

Parameters
generatorAn optional random generator.
maxThe maximum generated value.
Returns
A random number from 0-max.

Member Data Documentation

double SentinelMission.SentinelUtilities.MaxAsteroidEccentricity = 0.4
static
double SentinelMission.SentinelUtilities.MaxAsteroidInclination = 40
static
double SentinelMission.SentinelUtilities.MinAsteroidEccentricity = 0.05
static
double SentinelMission.SentinelUtilities.MinAsteroidInclination = 5
static
int SentinelMission.SentinelUtilities.perSentinelObjectLimit = 10
static

How many untracked objects each sentinel can track

Property Documentation

string SentinelMission.SentinelUtilities.SentinelModuleDisplayName
staticgetset
string SentinelMission.SentinelUtilities.SentinelModuleName
staticgetset
string SentinelMission.SentinelUtilities.SentinelPartDisplayName
staticgetset
string SentinelMission.SentinelUtilities.SentinelPartName
staticgetset
string SentinelMission.SentinelUtilities.SentinelPartTitle
staticget
double SentinelMission.SentinelUtilities.SentinelViewAngle
staticgetset
float SentinelMission.SentinelUtilities.SpawnChance
staticgetset
int SentinelMission.SentinelUtilities.WeightedStability
staticgetset

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