FractalUK / KSPInterstellar

KSP Instellar Mod for Kerbal Space Program
115 stars 67 forks source link

FNImpactorModule revision to improve detection of impacts from complex craft #31

Closed toadicus closed 9 years ago

toadicus commented 10 years ago

Current KSPI impact detection uses Part::onJustAboutToBeDestroyed, which is among the last events fired during a part's collision. Furthermore, the current implementation only watches the root part for a given vessel.

This is problematic given the way KSP tracks vessel velocity during an impact, especially for larger craft, where changes in design or orientation may necessitate that the root part's collision is not handled during the first update when a vessel crashes. For parts collisions handled in updates after the first collision in a crash, KSP registers the vessel's velocity as zero, preventing the impactor code from running.

This revision ameliorates this problem by watching all part collisions and crashes and filtering out irrelevant events before determing the scientific value, if any, and recording it.