- Changed scale_radius() from linear to logarithmic: scale * log10(radius)
- Adjusted size_scale from 1e-9 to 0.02 for better visual hierarchy
- Lowered min_radius from 0.5f to 0.01f for fine-grained visibility
- Updated rendering documentation with new scaling values
This handles extreme radius ranges (1.5M to 700M meters) while maintaining
visible size differences between Sun, planets, and moons.
- Correct OrbitalElements struct to match orbital_mechanics.h
- Update CelestialBody and Spacecraft structs to show OrbitalElements field
- Update Config Loader section with orbital elements format
- Add new Config Validator module section with all validation functions
- Update Initialization Sequence to include run_all_config_validations()
- Update config examples to use orbit table instead of state vectors
- Implemented union in OrbitalElements (semi_major_axis | semi_latus_rectum)
- Updated config_loader to validate parabolic vs elliptical/hyperbolic orbits
- Fixed orbital_mechanics.cpp parabolic case to use semi_latus_rectum
- Updated parabolic_comet.toml to use correct orbital parameters
- Updated validation logic for both bodies and spacecraft
- Created docs/parabolic_union_implementation.md with full implementation plan
- Updated docs/unified_orbital_elements_plan.md to mark phases 7-9 complete
Note: Parabolic orbit test velocity tolerance check fails due to test expecting
velocity at 1 AU, but config has comet at perihelion (0.5 AU).
Position and velocity are mathematically correct, energy is ~0.
- Added orbital_mechanics module with orbital_elements_to_cartesian()
- Updated initialize_orbital_objects() to use orbital mechanics
- Added validate_initial_positions() for post-initialization checking
- Fixed test files to use global_position/global_velocity
- Updated config loader to support spacecraft altitude parameter
- Fixed orbital_mechanics.cpp velocity calculation bug (removed duplicate scaling)
- Updated Makefile to include orbital_mechanics.o in test build
- Renamed simulation.h OrbitalMetrics to OrbitalAnalysis to avoid conflict
- Added docs/parabolic_union_implementation.md for parabolic orbit support plan
Note: Test configs still need manual fix for orbit table TOML syntax
- Replace position/velocity with orbit table parsing
- Parse all orbital element fields with defaults
- Support altitude convenience field for semi_major_axis
- Add validation for orbital elements
- Remove manual position/velocity calculation from loader
- Build succeeds (expected unused function warning)
- Rename CelestialBody/Spacecraft position/velocity to global_*
- Add OrbitalElements struct to both bodies and spacecraft
- Rename old OrbitalElements to OrbitalMetrics (for output/analysis)
- Update all references throughout codebase
- Preserve parent_index in outer structs (not in OrbitalElements)
- Build succeeds with only unused variable warning
Replace 3D billboard rendering with 2D screen-space overlays using
GetWorldToScreen() and DrawTexturePro() for constant visibility.
Changes:
- Rename render functions to *_screen_space suffix
- Use GetWorldToScreen() to transform 3D positions to screen coordinates
- Replace DrawBillboard/DrawBillboardPro() with DrawTexturePro() for 2D rendering
- Use constant pixel sizes (40px spacecraft, 20-60px markers)
- Add off-screen culling to skip rendering outside viewport
- Update render order: 3D scene first, then 2D overlays
- Update documentation to reflect screen-space approach
Benefits:
- Markers remain visible at all zoom levels (constant screen size)
- Simplified sizing with pixel values instead of world-space math
- Better performance with off-screen culling
- Clearer separation: 3D scene vs UI indicators
- Create ui_renderer.cpp/h with all raygui UI panel rendering functions
- Remove UI rendering code from renderer.cpp (421 lines moved)
- Remove UI state fields from RenderState, create separate UIState struct
- Remove raygui dependency from renderer module
- Update main.cpp to initialize UIState and call UI render functions
- Update documentation to reflect new module structure
- Improve separation of concerns between 3D rendering and UI overlays
Extract large update_simulation function into focused helpers:
- update_bodies_physics() - Handle body RK4 and SOI transitions
- update_spacecraft_physics() - RK4 integration for spacecraft
- execute_pending_maneuvers() - Check triggers and execute burns
- compute_spacecraft_globals() - Global coords for spacecraft
Simplified update_simulation to call helpers sequentially:
1. Bodies physics
2. Bodies global coords
3. Spacecraft physics
4. Maneuver execution
5. Spacecraft global coords
6. Time step
Benefits:
- Single responsibility per function
- Cleaner, more readable code
- Easier to test individual components
- Net change: +96 lines (helper functions) -86 lines (removal)
All maneuver tests still passing.
Updated docs to reflect that the spacecraft initialization bug has been
resolved by config validation.
docs/test_plan_invalid_parent_assignment.md:
- Changed status from "Implementation phase" to "Complete (Tests 1-3 resolved)"
- Updated bug diagnosis to show solution implemented
- Updated all test cases with actual results (Tests 1-3: ✅ PASS, Test 4: ❌ FAIL)
- Added implementation summary with commit references
- Updated test matrix to show actual results
- Updated future work section to reflect current status
docs/mission_planning.md:
- Marked FIXME as RESOLVED with solution details
- Updated spacecraft parameters to show corrected position
- Added note that delta-v issue remains pending
- Updated "position/velocity" line to reflect current implementation
Test Status:
- Test 1 (Earth→Spacecraft parent switch): ✅ RESOLVED
- Test 2 (Mass hierarchy): ✅ RESOLVED
- Test 3 (Config validation): ✅ RESOLVED
- Test 4 (Mutual SOI): ❌ PENDING (separate issue)
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.
Added comprehensive tests to capture parent-child relationship bugs:
- Test 1: Detect Earth becoming child of spacecraft (exact FIXME bug)
- Test 2: Validate mass hierarchy (massive bodies never have small parents)
- Test 3: Detect invalid config placeholder values (bodies at same position)
- Test 4: Mutual SOI edge case (similar-mass planets within SOI)
All tests fail as expected, documenting bugs for future fixes.
Tests 1-3 will pass after spacecraft separation fix.
Test 4 captures separate mutual SOI issue.
Files:
- docs/test_plan_invalid_parent_assignment.md (test plan)
- tests/test_invalid_parent_assignment.cpp (4 test cases)
- tests/configs/mutual_soi_close.toml (edge case config)
- Extract adaptive timestepping section from patched_conics_plan.md
- Add to mission_planning.md Future Work section (after Capture Burns)
- Problem: Fixed 60s timestep too coarse/fast for different orbital phases
- Solution: Adaptive timestep based on orbital period using Kepler's third law
- Implementation: calculate_adaptive_timestep() with 10s-600s clamping
- Delete obsolete patched_conics_plan.md (689 lines, superseded by implementation)
- Renumber sections 5-11 to accommodate new section 5
- Net reduction: ~645 lines of documentation
- Replace full function implementations with summaries
- Add references to actual source files for implementation details
- Replace full test code with test structure summary
- Replace full TOML config with config summary
- Reduced document from 744 to 459 lines (38% reduction)
- Improved maintainability: source code is now source of truth