Browse Source
Implement much simpler SOI transition logic: If parent is not root (parent_idx != 0): - Only two options: stay with parent or go to Sun - If within parent's SOI: stay with current parent - If outside parent's SOI: switch to Sun (index 0) If parent is root (parent_idx == 0): - Check all bodies for SOI containment - Find closest body whose SOI contains us - If no SOI contains us: stay with Sun Benefits: - Eliminates unnecessary N-body comparisons when inside parent's SOI - Prevents unphysical transitions (Moon→Mars while in Earth's SOI) - Much simpler and more maintainable logic - Enables proper patched conics: Earth→Sun→Mars→Sun→Earth Test results: - SOI transition test now passes (2 parent changes: Sun→Mars→Sun) - All 24 tests passing - Net change: +18/-21 linesmain
1 changed files with 18 additions and 21 deletions
Loading…
Reference in new issue