Class CelestialBody
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
[Nominal] A celestial body is able to represent a planet, moon, or other celestial object. This will be able to reflect the state of the body and can contribute to the gravitational forces in the simulation.
public class CelestialBody : UniverseObject
- Inheritance
-
CelestialBody
- Extension Methods
Constructors
CelestialBody()
Default constructor
protected CelestialBody()
Fields
AtmosphereType
Defines the current atmosphere type, if enabled
[ReadOnly]
[Metadata(IsAdvanced = true)]
public AtmosphereType AtmosphereType
Field Value
In_TimeMsg
A reference to the time message from the simulation that controls the time of the simulation and the state.
[Hidden]
public TimeMessage? In_TimeMsg
Field Value
IsCentralBody
The central body flag will define if this object is the central origin of the simulation
[ReadOnly]
[Metadata(IsAdvanced = true)]
public bool IsCentralBody
Field Value
IsSpherical
A flag whether the spherical model is being used for this celestial body. By default, planets are spherical but can be changed to use non-spherical models, such as the World Geodetic Model (WGS-84) standard for the Earth.
[ReadOnly]
[Metadata(IsAdvanced = true)]
public bool IsSpherical
Field Value
MagneticFieldType
Defines the current magnetic field type, if enabled
public MagneticFieldType MagneticFieldType
Field Value
Out_PlanetStateMsg
The Planet information about the current state of the planet and the information about the planet.
public PlanetStateMessage? Out_PlanetStateMsg
Field Value
Properties
Albedo
Defines the current albedo model that is attached to the body
[ReadOnly]
[Metadata(IsAdvanced = true)]
public AlbedoPlanetModel? Albedo { get; }
Property Value
AlbedoAverage
Average Albedo of the Body
[Unit(UnitType.NONE)]
[ReadOnly]
public double AlbedoAverage { get; }
Property Value
Atmosphere
Defines the current atmosphere model that is attached to the body
[ReadOnly]
[Metadata(IsAdvanced = true)]
public AtmospherePlanetModel? Atmosphere { get; }
Property Value
AxisInclination
Axial inclination, or tilt, of the body relative to the ecliptic
[Unit(UnitType.DEGREE)]
[ReadOnly]
public double AxisInclination { get; }
Property Value
AxisOmega
Angular velocity of the rotation of the body
[Unit(UnitType.RADIAN_PER_SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double AxisOmega { get; }
Property Value
Density
Density of the body
[Unit(UnitType.KILOGRAM_PER_CUBIC_METRE)]
[ReadOnly]
public double Density { get; }
Property Value
Diameter
Equatorial Diameter of the Body
[Unit(UnitType.METRE)]
[ReadOnly]
public double Diameter { get; }
Property Value
IsBarycenter
A flag for whether the body uses the barycenter name.
[Hidden]
public bool IsBarycenter { get; }
Property Value
J2
The measure of the gravitational effect of a planet due to its obliqueness.
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double J2 { get; }
Property Value
J2000Rotation
Orientation matrix of planet-fixed relative to inertial frame. This is the rotation matrix that can be used to convert between the two coordinate systems. This is the 'J20002PFix' matrix.
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_PlanetStateMsg")]
public Matrix3 J2000Rotation { get; }
Property Value
J2000RotationDot
Derivative of the orientation matrix of planet-fixed relative to inertial. This is the 'J20002PFix_Dot' matrix.
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_PlanetStateMsg")]
public Matrix3 J2000RotationDot { get; }
Property Value
MagneticField
Defines the current magnetic field model that is attached to the body
[ReadOnly]
[Metadata(IsAdvanced = true)]
public MagneticFieldPlanetModel? MagneticField { get; }
Property Value
Mass
The mass of the gravity body / planet
[Unit(UnitType.KILOGRAM)]
[ReadOnly]
public double Mass { get; }
Property Value
Mu
Gravitational Mu of the body
[Unit("Nm²/kg")]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double Mu { get; }
Property Value
OrbitEccentricity
Eccentricity of the orbit around the sun or parented body
[Unit(UnitType.NONE)]
[ReadOnly]
public double OrbitEccentricity { get; }
Property Value
OrbitInclination
Inclination of the orbit around the sun or parented body
[Unit(UnitType.DEGREE)]
[ReadOnly]
public double OrbitInclination { get; }
Property Value
OrbitPeriod
Period of the orbit around the sun or parented body
[Unit(UnitType.DAY)]
[ReadOnly]
public double OrbitPeriod { get; }
Property Value
OrbitSemiMajorAxis
Semi Major Axis of the orbit around the sun or parented body
[Unit(UnitType.METRE)]
[ReadOnly]
public double OrbitSemiMajorAxis { get; }
Property Value
PolarRadius
Polar Radius of the Body
[Unit(UnitType.METRE)]
[ReadOnly]
public double PolarRadius { get; }
Property Value
Radius
Equatorial Radius of the Body
[Unit(UnitType.METRE)]
[ReadOnly]
public double Radius { get; }
Property Value
SiderealDay
The time between two consecutive meridian crossings of the Sun
[Unit(UnitType.SECOND)]
[ReadOnly]
public double SiderealDay { get; }
Property Value
SolarDay
The time it takes for the body to rotate once relative to the Sun
[Unit(UnitType.SECOND)]
[ReadOnly]
public double SolarDay { get; }
Property Value
SphericalHarmonics
Defines the current spherical harmonics model that is attached to the body
[ReadOnly]
[Metadata(IsAdvanced = true)]
public SphericalHarmonicsModel? SphericalHarmonics { get; }
Property Value
SpiceName
The name of the object for SPICE calculations.
[Hidden]
public string SpiceName { get; }
Property Value
Velocity
The Inertial Velocity of the Body relative to the Central Body
[Unit(UnitType.METRE_PER_SECOND)]
[ReadOnly]
[Metadata(ContainedIn = "Out_PlanetStateMsg")]
public Vector3 Velocity { get; }
Property Value
Methods
ComputeInertialGravity(Vector3, double)
Calculates the gravity from this body at some location.
public Vector3 ComputeInertialGravity(Vector3 inertialPosition, double step)
Parameters
inertialPosition
Vector3The inertial reference frame location of the object [m]
step
doubleThe time difference in step for spherical harmonics [s]
Returns
- Vector3
The gravitational force vector
ComputePotentialEnergy(Vector3)
Calculates the potential energy of the body at some location.
public double ComputePotentialEnergy(Vector3 inertialPosition)
Parameters
inertialPosition
Vector3[m] The inertial reference frame location of the object
Returns
- double
[J] The gravitational energy
OnCreate()
Called when the 'Component' is created from the controller.
protected override void OnCreate()
OnLoad(double)
Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.
protected override void OnLoad(double time)
Parameters
time
double[s] The current clock time of the simulation
OnUpdate(double, double)
Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.
protected override void OnUpdate(double time, double step)
Parameters
time
double[s] Current time of the simulation before the update
step
double[s] The time-step to update during this tick
Events
OnTransformChanged
An event when is triggered when the rotation changes to ensure that any dependent objects are updated.
public event Action? OnTransformChanged