Represents a set of asteroids with similar orbits.
More...
|
override string | ToString () |
| Returns a string that represents the current object. More...
|
|
|
static double | anomalyToLong (double anom, double i, double aPe, double lAn) |
| Converts an anomaly to an orbital longitude. More...
|
|
static double | longToAnomaly (double longitude, double i, double aPe, double lAn) |
| Converts an orbital longitude to an anomaly. More...
|
|
static CelestialBody | getPlanetByName (string name) |
| Searches KSP for a celestial body. More...
|
|
static double | getStartUt () |
| Returns the time at the start of the game. More...
|
|
|
string | name |
| A unique name for the population.
|
|
string | title |
| The name of asteroids belonging to this population.
|
|
string | centralBody |
| The name of the celestial object orbited by the asteroids.
|
|
double | spawnRate |
| The rate, in asteroids per Earth day, at which asteroids are discovered.
|
|
SizeRange | orbitSize |
| The size (range) of orbits in this population.
|
|
ValueRange | eccentricity |
| The eccentricity (range) of orbits in this population.
|
|
ValueRange | inclination |
| The inclination (range) of orbits in this population.
|
|
PeriRange | periapsis |
| The argument/longitude of periapsis (range) of orbits in this population.
|
|
ValueRange | ascNode |
| The longitude of ascending node (range) of orbits in this population.
|
|
PhaseRange | orbitPhase |
| The range of positions along the orbit for asteroids in this population.
|
|
Represents a set of asteroids with similar orbits.
- Warning
- Population objects are typically initialized using an external traversal, rather than a constructor. Therefore, traditional validity guarantees cannot be enforced. Instead, the Population class makes heavier than usual use of defensive programming.
- Note
- To avoid breaking the persistence code, Population may not have subclasses
Creates a dummy population.
- Postcondition
- The object is initialized to a state in which it will not be expected to generate orbits. Any orbits that are generated will be located inside the Sun, causing the game to immediately delete the object with the orbit.
- Exception Safety
- Does not throw exceptions.
- Note
- Required by interface of ConfigNode.LoadObjectFromConfig()
static double anomalyToLong |
( |
double |
anom, |
|
|
double |
i, |
|
|
double |
aPe, |
|
|
double |
lAn |
|
) |
| |
|
staticprivate |
Converts an anomaly to an orbital longitude.
- Parameters
-
[in] | anom | The angle between the periapsis point and a position in the planet's orbital plane. May be mean, eccentric, or true anomaly. |
[in] | i | The inclination of the planet's orbital plane |
[in] | aPe | The argument of periapsis of the planet's orbit |
[in] | lAn | The longitude of ascending node of this planet's orbital plane |
- Returns
- The angle between the reference direction (coordinate x-axis) and the projection of a position onto the x-y plane. Will be mean, eccentric, or true longitude, corresponding to the type of anomaly provided.
- Exception Safety
- Does not throw exceptions
Generates a random orbit consistent with the population properties.
- Returns
- The orbit of a randomly selected member of the population
- Exceptions
-
System.InvalidOperationException | Thrown if population's parameter values cannot produce valid orbits. |
- Exception Safety
- The program is in a consistent state in the event of an exception
- Todo:
- Break up this function
string getAsteroidName |
( |
| ) |
|
|
package |
Returns the name of asteroids within the population.
- Returns
- A human-readable string that can be used as an asteroid prefix.
- Exception Safety
- Does not throw exceptions.
Returns the name of the population.
- Returns
- A human-readable string identifying the population.
- Exception Safety
- Does not throw exceptions.
static CelestialBody getPlanetByName |
( |
string |
name | ) |
|
|
staticprivate |
Searches KSP for a celestial body.
- Parameters
-
[in] | name | The exact, case-sensitive name of the celestial body to recover |
- Returns
- The celestial body named
name
- Precondition
- All loaded celestial bodies have unique names
- Exceptions
-
ArgumentException | Thrown if no celestial body named name exists |
- Exception Safety
- This method is atomic
Returns the rate at which asteroids are discovered in the population.
- Returns
- The number of asteroids discovered per Earth day.
- Exception Safety
- Does not throw exceptions.
static double getStartUt |
( |
| ) |
|
|
staticprivate |
Returns the time at the start of the game.
- Returns
- If playing stock KSP, returns 0 UT. If playing Real Solar System, returns
RealSolarSystem.cfg/REALSOLARSYSTEM.Epoch
- Exception Safety
- Does not throw exceptions
static double longToAnomaly |
( |
double |
longitude, |
|
|
double |
i, |
|
|
double |
aPe, |
|
|
double |
lAn |
|
) |
| |
|
staticprivate |
Converts an orbital longitude to an anomaly.
- Parameters
-
[in] | longitude | The angle between the reference direction (coordinate x-axis) and the projection of a position onto the x-y plane, in degrees. May be mean, eccentric, or true longitude. |
[in] | i | The inclination of the planet's orbital plane |
[in] | aPe | The argument of periapsis of the planet's orbit |
[in] | lAn | The longitude of ascending node of this planet's orbital plane |
- Returns
- The angle between the periapsis point and a position in the planet's orbital plane, in degrees. Will be mean, eccentric, or true anomaly, corresponding to the type of longitude provided.
- Exception Safety
- Does not throw exceptions
override string ToString |
( |
| ) |
|
Returns a string that represents the current object.
- Returns
- A simple string identifying the object
- See Also
- Object.ToString()
The documentation for this class was generated from the following file: