diff --git a/docs/unified_orbital_elements_plan.md b/docs/unified_orbital_elements_plan.md index 1d964f0..0d1c7b6 100644 --- a/docs/unified_orbital_elements_plan.md +++ b/docs/unified_orbital_elements_plan.md @@ -272,23 +272,24 @@ struct Spacecraft { - `config_loader.cpp`: Update call after config load - Tests: Update if they call initialization directly -### Phase 5: Update Test Configs +### Phase 5: Update Test Configs ✅ COMPLETE -13. **Update all test configs to use new format** +13. ✅ **Update all test configs to use new format** **Configs to update:** - - `tests/configs/solar_system.toml` - All planets and moons - - `tests/configs/earth_circular.toml` - Simple test - - `tests/configs/mars_circular.toml` - Simple test - - `tests/configs/spacecraft_test.toml` - Spacecraft example - - `tests/configs/interplanetary_transfer.toml` - Transfer orbit - - `tests/configs/hyperbolic_comet.toml` - Hyperbolic escape - - `tests/configs/parabolic_comet.toml` - Parabolic escape - - `tests/configs/soi_transition.toml` - SOI crossing - - `tests/configs/simple_root_transition.toml` - SOI test - - `tests/configs/manual_root_transition.toml` - SOI test - - `tests/configs/mutual_soi_close.toml` - Multi-body - - `tests/configs/maneuver_sequence.toml` - Maneuver planning + - ✅ `tests/configs/solar_system.toml` - All planets and moons + - ✅ `tests/configs/earth_circular.toml` - Simple test + - ✅ `tests/configs/mars_circular.toml` - Simple test + - ✅ `tests/configs/spacecraft_test.toml` - Spacecraft example + - ✅ `tests/configs/interplanetary_transfer.toml` - Transfer orbit + - ✅ `tests/configs/hyperbolic_comet.toml` - Hyperbolic escape + - ✅ `tests/configs/parabolic_comet.toml` - Parabolic escape + - ✅ `tests/configs/soi_transition.toml` - SOI crossing + - ✅ `tests/configs/simple_root_transition.toml` - SOI test + - ✅ `tests/configs/manual_root_transition.toml` - SOI test + - ✅ `tests/configs/mutual_soi_close.toml` - Multi-body + - ✅ `tests/configs/maneuver_sequence.toml` - Maneuver planning + - ✅ `tests/configs/earth_mars_simple.toml` - Earth-Mars with spacecraft **Example transformation:** @@ -463,9 +464,9 @@ This is a **major breaking change** that affects all configs and code: - Help identify old vs new config formats (if we ever need backward compat) ## Success Criteria -1. [ ] All test configs updated to new format -2. [ ] Config loader successfully parses `orbit` tables -3. [ ] `orbital_elements_to_cartesian()` correctly converts all orbit types +1. [x] All test configs updated to new format +2. [x] Config loader successfully parses `orbit` tables +3. [x] `orbital_elements_to_cartesian()` correctly converts all orbit types 4. [x] `initialize_orbital_objects()` sets up bodies and spacecraft correctly 5. [x] All references to `position`/`velocity` renamed to `global_*` 6. [ ] Renderer displays orbits correctly diff --git a/tests/configs/earth_circular.toml b/tests/configs/earth_circular.toml index 01d6f13..7746750 100644 --- a/tests/configs/earth_circular.toml +++ b/tests/configs/earth_circular.toml @@ -6,18 +6,22 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 \ No newline at end of file +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} diff --git a/tests/configs/earth_mars_simple.toml b/tests/configs/earth_mars_simple.toml index 11b36ed..b3c30a9 100644 --- a/tests/configs/earth_mars_simple.toml +++ b/tests/configs/earth_mars_simple.toml @@ -2,31 +2,37 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Mars" mass = 6.39e23 radius = 3.3895e6 -position = { x = 2.279e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.3, b = 0.1 } -eccentricity = 0.0 -semi_major_axis = 2.279e11 +orbit = { + semi_major_axis = 2.279e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Spacecraft" @@ -34,9 +40,11 @@ mass = 1.0 radius = 1000.0 # Position at LEO altitude: Earth position + (Earth radius + 200km altitude) # Earth: 1.496e11, LEO offset: 6.571e6, Total: 1.49606571e11 -position = { x = 1.49606571e11, y = 0.0, z = 0.0 } parent_index = 1 color = { r = 1.0, g = 0.0, b = 0.5 } -eccentricity = 0.0 -# Semi-major axis: Earth radius + 200km LEO altitude -semi_major_axis = 6.571e6 +orbit = { + # Semi-major axis: Earth radius + 200km LEO altitude + semi_major_axis = 6.571e6 + eccentricity = 0.0 + true_anomaly = 0.0 +} diff --git a/tests/configs/hyperbolic_comet.toml b/tests/configs/hyperbolic_comet.toml index ffd0fcc..b55e908 100644 --- a/tests/configs/hyperbolic_comet.toml +++ b/tests/configs/hyperbolic_comet.toml @@ -6,18 +6,22 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "HyperbolicComet" mass = 1.0e14 radius = 5.0e3 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.5, g = 1.0, b = 0.5 } -eccentricity = 1.5 -semi_major_axis = -1.496e11 +orbit = { + semi_major_axis = -1.496e11 + eccentricity = 1.5 + true_anomaly = 0.0 +} diff --git a/tests/configs/interplanetary_transfer.toml b/tests/configs/interplanetary_transfer.toml index ab9ad0c..bbb9b16 100644 --- a/tests/configs/interplanetary_transfer.toml +++ b/tests/configs/interplanetary_transfer.toml @@ -6,31 +6,37 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Mars" mass = 6.39e23 radius = 3.3895e6 -position = { x = 2.279e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.3, b = 0.1 } -eccentricity = 0.0 -semi_major_axis = 2.279e11 +orbit = { + semi_major_axis = 2.279e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Probe" @@ -38,9 +44,11 @@ mass = 1.0e3 radius = 1.0e1 # Start at Earth's position, moving toward Mars # The probe will escape Earth's SOI and transition to Sun, then to Mars -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 # Start orbiting Sun color = { r = 0.0, g = 1.0, b = 0.0 } -# Use elliptical transfer orbit with semi_major_axis halfway between Earth and Mars -eccentricity = 0.3 -semi_major_axis = 1.888e11 +orbit = { + # Use elliptical transfer orbit with semi_major_axis halfway between Earth and Mars + semi_major_axis = 1.888e11 + eccentricity = 0.3 + true_anomaly = 0.0 +} diff --git a/tests/configs/maneuver_sequence.toml b/tests/configs/maneuver_sequence.toml index a407132..ff3dd6f 100644 --- a/tests/configs/maneuver_sequence.toml +++ b/tests/configs/maneuver_sequence.toml @@ -6,28 +6,35 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[spacecraft]] name = "LEO_Satellite" mass = 1000.0 -position = { x = 0.0, y = 6.771e6, z = 0.0 } -velocity = { x = 7660.0, y = 0.0, z = 0.0 } parent_index = 1 +orbit = { + altitude = 400000.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[maneuvers]] name = "orbit_raise_1" diff --git a/tests/configs/manual_root_transition.toml b/tests/configs/manual_root_transition.toml index e1a77ac..4af8cee 100644 --- a/tests/configs/manual_root_transition.toml +++ b/tests/configs/manual_root_transition.toml @@ -5,40 +5,47 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Mars" mass = 6.39e23 radius = 3.3895e6 -position = { x = 2.279e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.3, b = 0.1 } -eccentricity = 0.0 -semi_major_axis = 2.279e11 +orbit = { + semi_major_axis = 2.279e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} # Probe starts well outside Earth's SOI to force Sun transition [[bodies]] name = "Probe" mass = 1.0e3 radius = 1.0e1 -# Position probe between Earth and Mars, closer to Mars -position = { x = 2.0e11, y = 0.0, z = 0.0 } parent_index = 1 # Start with Earth as parent color = { r = 1.0, g = 0.0, b = 0.0 } -eccentricity = 0.1 -semi_major_axis = 2.5e11 # Large orbit around Sun +orbit = { + semi_major_axis = 2.5e11 # Large orbit around Sun + eccentricity = 0.1 + true_anomaly = 0.0 +} diff --git a/tests/configs/mars_circular.toml b/tests/configs/mars_circular.toml index 36bcbf4..f59f810 100644 --- a/tests/configs/mars_circular.toml +++ b/tests/configs/mars_circular.toml @@ -6,18 +6,22 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Mars" mass = 6.39e23 radius = 3.3895e6 -position = { x = 2.244e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.3, b = 0.1 } -eccentricity = 0.0 -semi_major_axis = 2.244e11 \ No newline at end of file +orbit = { + semi_major_axis = 2.244e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} diff --git a/tests/configs/mutual_soi_close.toml b/tests/configs/mutual_soi_close.toml index bcd94bd..d3d51d6 100644 --- a/tests/configs/mutual_soi_close.toml +++ b/tests/configs/mutual_soi_close.toml @@ -7,28 +7,34 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "PlanetA" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.8, b = 0.3 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "PlanetB" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.501e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.8, b = 0.3 } -eccentricity = 0.0 -semi_major_axis = 1.501e11 +orbit = { + semi_major_axis = 1.501e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} diff --git a/tests/configs/parabolic_comet.toml b/tests/configs/parabolic_comet.toml index 7eb08e1..eac1588 100644 --- a/tests/configs/parabolic_comet.toml +++ b/tests/configs/parabolic_comet.toml @@ -6,18 +6,22 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "ParabolicComet" mass = 1.0e14 radius = 5.0e3 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.7, g = 0.8, b = 0.9 } -eccentricity = 1.0 -semi_major_axis = 1.0e30 +orbit = { + semi_major_axis = 1.0e30 + eccentricity = 1.0 + true_anomaly = 0.0 +} diff --git a/tests/configs/simple_root_transition.toml b/tests/configs/simple_root_transition.toml index 990ec77..84fbd5a 100644 --- a/tests/configs/simple_root_transition.toml +++ b/tests/configs/simple_root_transition.toml @@ -6,39 +6,47 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Mars" mass = 6.39e23 radius = 3.3895e6 -position = { x = 2.279e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.3, b = 0.1 } -eccentricity = 0.0 -semi_major_axis = 2.279e11 +orbit = { + semi_major_axis = 2.279e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} # Probe starts near Earth, in Earth's SOI [[bodies]] name = "Probe" mass = 1.0e3 radius = 1.0e1 -position = { x = 1.496e11, y = 5.0e8, z = 0.0 } parent_index = 1 color = { r = 1.0, g = 0.0, b = 1.0 } -eccentricity = 0.2 -semi_major_axis = 5.0e8 +orbit = { + semi_major_axis = 5.0e8 + eccentricity = 0.2 + true_anomaly = 0.0 +} diff --git a/tests/configs/soi_transition.toml b/tests/configs/soi_transition.toml index 835d08a..cc1dbb7 100644 --- a/tests/configs/soi_transition.toml +++ b/tests/configs/soi_transition.toml @@ -7,28 +7,34 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Mars" mass = 6.39e23 radius = 3.3895e6 -position = { x = 2.244e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.3, b = 0.1 } -eccentricity = 0.0 -semi_major_axis = 2.244e11 +orbit = { + semi_major_axis = 2.244e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "SmallBody" mass = 1.0e14 radius = 5.0e3 -position = { x = 1.122e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.5, g = 0.8, b = 1.0 } -eccentricity = 0.7 -semi_major_axis = 3.74e11 +orbit = { + semi_major_axis = 3.74e11 + eccentricity = 0.7 + true_anomaly = 0.0 +} diff --git a/tests/configs/solar_system.toml b/tests/configs/solar_system.toml index 7719540..d0800ce 100644 --- a/tests/configs/solar_system.toml +++ b/tests/configs/solar_system.toml @@ -4,138 +4,166 @@ name = "Sun" mass = 1.989e30 # kg radius = 6.96e8 # m -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Venus" mass = 4.867e24 radius = 6.0518e6 -position = { x = 1.082e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.9, g = 0.7, b = 0.3 } -eccentricity = 0.0 -semi_major_axis = 1.082e11 +orbit = { + semi_major_axis = 1.082e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Mars" mass = 6.39e23 radius = 3.3895e6 -position = { x = 2.279e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.8, g = 0.3, b = 0.1 } -eccentricity = 0.0 -semi_major_axis = 2.279e11 +orbit = { + semi_major_axis = 2.279e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Jupiter" mass = 1.898e27 radius = 6.9911e7 -position = { x = 7.785e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.9, g = 0.7, b = 0.5 } -eccentricity = 0.0 -semi_major_axis = 7.785e11 +orbit = { + semi_major_axis = 7.785e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Saturn" mass = 5.683e26 radius = 5.8232e7 -position = { x = 1.434e12, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.9, g = 0.8, b = 0.6 } -eccentricity = 0.0 -semi_major_axis = 1.434e12 +orbit = { + semi_major_axis = 1.434e12 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Uranus" mass = 8.681e25 radius = 2.5362e7 -position = { x = 2.871e12, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.5, g = 0.8, b = 0.9 } -eccentricity = 0.0 -semi_major_axis = 2.871e12 +orbit = { + semi_major_axis = 2.871e12 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Neptune" mass = 1.024e26 radius = 2.4622e7 -position = { x = 4.495e12, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.2, g = 0.4, b = 0.9 } -eccentricity = 0.0 -semi_major_axis = 4.495e12 +orbit = { + semi_major_axis = 4.495e12 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Moon" mass = 7.342e22 radius = 1.737e6 - position = { x = 1.49984e11, y = 0.0, z = 0.0 } parent_index = 2 color = { r = 0.7, g = 0.7, b = 0.7 } - eccentricity = 0.0 - semi_major_axis = 3.844e8 + orbit = { + semi_major_axis = 3.844e8 + eccentricity = 0.0 + true_anomaly = 0.0 + } [[bodies]] name = "Io" mass = 8.93e22 radius = 1.822e6 - position = { x = 7.789e11, y = 0.0, z = 0.0 } parent_index = 4 color = { r = 0.9, g = 0.9, b = 0.3 } - eccentricity = 0.0 - semi_major_axis = 4.217e8 + orbit = { + semi_major_axis = 4.217e8 + eccentricity = 0.0 + true_anomaly = 0.0 + } [[bodies]] name = "Europa" mass = 4.80e22 radius = 1.561e6 - position = { x = 7.792e11, y = 0.0, z = 0.0 } parent_index = 4 color = { r = 0.8, g = 0.8, b = 0.7 } - eccentricity = 0.0 - semi_major_axis = 6.709e8 + orbit = { + semi_major_axis = 6.709e8 + eccentricity = 0.0 + true_anomaly = 0.0 + } [[bodies]] name = "Ganymede" mass = 1.48e23 radius = 2.634e6 - position = { x = 7.796e11, y = 0.0, z = 0.0 } parent_index = 4 color = { r = 0.6, g = 0.6, b = 0.5 } - eccentricity = 0.0 - semi_major_axis = 1.070e9 + orbit = { + semi_major_axis = 1.070e9 + eccentricity = 0.0 + true_anomaly = 0.0 + } [[bodies]] name = "Callisto" mass = 1.08e23 radius = 2.410e6 - position = { x = 7.804e11, y = 0.0, z = 0.0 } parent_index = 4 color = { r = 0.5, g = 0.5, b = 0.4 } - eccentricity = 0.0 - semi_major_axis = 1.883e9 + orbit = { + semi_major_axis = 1.883e9 + eccentricity = 0.0 + true_anomaly = 0.0 + } [[bodies]] name = "Titan" mass = 1.345e23 radius = 2.575e6 - position = { x = 1.43522e12, y = 0.0, z = 0.0 } parent_index = 5 color = { r = 0.9, g = 0.6, b = 0.3 } - eccentricity = 0.0 - semi_major_axis = 1.222e9 + orbit = { + semi_major_axis = 1.222e9 + eccentricity = 0.0 + true_anomaly = 0.0 + } diff --git a/tests/configs/spacecraft_test.toml b/tests/configs/spacecraft_test.toml index 36453fa..498cff9 100644 --- a/tests/configs/spacecraft_test.toml +++ b/tests/configs/spacecraft_test.toml @@ -6,25 +6,32 @@ name = "Sun" mass = 1.989e30 radius = 6.96e8 -position = { x = 0.0, y = 0.0, z = 0.0 } parent_index = -1 color = { r = 1.0, g = 1.0, b = 0.0 } -eccentricity = 0.0 -semi_major_axis = 0.0 +orbit = { + semi_major_axis = 0.0 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[bodies]] name = "Earth" mass = 5.972e24 radius = 6.371e6 -position = { x = 1.496e11, y = 0.0, z = 0.0 } parent_index = 0 color = { r = 0.0, g = 0.5, b = 1.0 } -eccentricity = 0.0 -semi_major_axis = 1.496e11 +orbit = { + semi_major_axis = 1.496e11 + eccentricity = 0.0 + true_anomaly = 0.0 +} [[spacecraft]] name = "LEO_Satellite" mass = 1000.0 -position = { x = 0.0, y = 6.771e6, z = 0.0 } -velocity = { x = 7660.0, y = 0.0, z = 0.0 } parent_index = 1 +orbit = { + altitude = 400000.0 + eccentricity = 0.0 + true_anomaly = 0.0 +}