Browse Source
Remove complex hysteresis logic and implement simple SOI-based parent switching: bodies stay with current parent while within its SOI, and switch to closest body whose SOI contains them when exiting. This eliminates unnecessary N-body comparisons when inside current parent's SOI, preventing unphysical transitions (e.g., Moon→Mars while still in Earth's SOI). Simplified logic: - Within parent's SOI → STAY with current parent - Outside parent's SOI → FIND new parent (closest body whose SOI contains us) - If no SOI contains us → fall back to Sun (index 0) This matches simple 2-body simulation model and makes the code much clearer and more maintainable. Note: SOI transition test temporarily expects hysteresis behavior and will need to be updated in follow-up commit.main
2 changed files with 26 additions and 32 deletions
Loading…
Reference in new issue