Browse Source
Added validation in config_loader to prevent bodies from starting too close to their parent bodies (distance must be >= parent.radius + body.radius). Changes: - src/config_loader.cpp: Add parent-child distance validation before initialization - tests/configs/earth_mars_simple.toml: Fix spacecraft position to LEO altitude (Earth position + 6.571e6 m offset = 1.49606571e11 m) - tests/test_invalid_parent_assignment.cpp: Update test 3 to use radius-based validation - docs/mission_planning.md: Add TODO about spacecraft config pattern changes Test results: - Test 1: ✅ PASS (Earth no longer becomes child of spacecraft) - Test 2: ✅ PASS (Mass hierarchy preserved) - Test 3: ✅ PASS (Spacecraft at valid LEO position) - Test 4: ❌ FAIL (mutual SOI bug, as expected) This prevents the spacecraft initialization bug where Earth would incorrectly become a child of the spacecraft due to distance=0.main
4 changed files with 43 additions and 5 deletions
Loading…
Reference in new issue