diff options
Diffstat (limited to 'src/solar_system/orbit.rs')
| -rw-r--r-- | src/solar_system/orbit.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/solar_system/orbit.rs b/src/solar_system/orbit.rs index f5a564c..b29e2c2 100644 --- a/src/solar_system/orbit.rs +++ b/src/solar_system/orbit.rs @@ -1,9 +1,11 @@ -use crate::solar_system::{Angle, BodyId, Kilometers, OrbitalBody, Percentage}; +use crate::solar_system::{Angle, BodyId, Kilometers, OrbitalBody, Percentage, SystemId}; use crate::timeman::{Second}; pub struct StaticOrbit { parent: BodyId, + system: SystemId, + eccentricity: Percentage, inclination: Angle, long_asc_node: Angle, @@ -23,6 +25,7 @@ impl StaticOrbit { pub fn new( parent: BodyId, + system: SystemId, eccentricity: Percentage, inclination: Angle, long_asc_node: Angle, @@ -32,6 +35,7 @@ impl StaticOrbit -> Self { Self { parent, + system, eccentricity, inclination, long_asc_node, @@ -48,6 +52,7 @@ impl StaticOrbit { Self { parent: parent.id(), + system: parent.system(), eccentricity: 1e-6, inclination: 0.0, long_asc_node: 0.0, @@ -65,9 +70,8 @@ impl StaticOrbit ((self.semi_major_axis.powf(3.0) / this_body.sgp()).sqrt() * std::f64::consts::TAU) as Second } - pub fn parent(&self) -> BodyId { - self.parent - } + pub fn parent(&self) -> BodyId { self.parent } + pub fn system(&self) -> SystemId { self.system } pub fn sma(&self) -> Kilometers { self.semi_major_axis } |
