Colossal.Atmosphere.MoonCoordinate
Assembly: Assembly-CSharp
Namespace: Colossal.Atmosphere
Type: struct
Base: System.ValueType
Summary: Represents the Moon's coordinates relative to a local observing point. Holds topocentric (observer-centered) coordinates together with the distance to the Moon and the Moon's parallactic angle. Exact units are not declared in the source; in the game codebase these values are typically represented as double-precision values (distance commonly in meters and angles in radians), but consult related types (e.g., TopocentricCoordinates) for precise unit conventions.
Fields
-
public TopocentricCoordinates topoCoords
Holds the topocentric coordinates of the Moon for the local observer. Topocentric coordinates typically include azimuth / altitude (or similar observer-centered angles). See the TopocentricCoordinates type for details about the fields and units. -
public double distance
Distance from the observer to the Moon. The source defines this as a double; unit is not explicit in this struct — likely meters in the surrounding codebase. Use caution and verify unit expectations when performing calculations or conversions. -
public double parallacticAngle
The parallactic angle of the Moon at the observer's location. Represented as a double. Units are not specified here (commonly radians in astronomical calculations); verify with calling code or related utility functions.
Properties
- This type defines no properties.
Constructors
public MoonCoordinate()
Structs in C# have an implicit parameterless constructor that initializes fields to their default values (topoCoords default, distance = 0.0, parallacticAngle = 0.0). The source does not declare any explicit constructors.
Methods
- This type defines no methods.
Usage Example
// Example usage (assumes TopocentricCoordinates type is available)
TopocentricCoordinates topo = new TopocentricCoordinates
{
// fill in fields according to that type (e.g., azimuth, altitude)
};
MoonCoordinate moon = new MoonCoordinate
{
topoCoords = topo,
distance = 384_400_000.0, // example: average Earth–Moon distance in meters
parallacticAngle = 0.0 // example value (radians)
};
// Read values
var az = moon.topoCoords.azimuth; // depending on TopocentricCoordinates definition
var alt = moon.topoCoords.altitude;
double dist = moon.distance;
double pa = moon.parallacticAngle;
Notes: - Refer to TopocentricCoordinates in Colossal.Atmosphere to understand how topocentric fields are represented and which units are used across the atmosphere/astronomy code paths. - If you need a convenience constructor or helpers (e.g., unit conversions), consider adding extension methods or a wrapper type in your mod to avoid duplicating assumptions about units.