Gravity: the Planet guard refuses an unphysical well; tests pin the Roche rule, per-body multipliers, the core band and Ship's order
A WellStrength that evaluates negative, NaN or infinite now throws at construction (it built an antimass well with NaN height). New tests: the core-inside-Roche guard judged at every mass on curves that cross in the generated range; per-body multipliers move neither strength, core nor Roche limit; potential and force consistency inside the cores' outer bands (0.5 R to R); a moving Ship feels the field where it has moved to. Not built or run locally; verified in the Yggdrasil job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8013c2deec
commit
c4dfd905ff
3 changed files with 131 additions and 3 deletions
|
|
@ -712,6 +712,8 @@ public class Planet
|
|||
WellStrength = Settings.WellStrength.Evaluate(BodyData.Mass);
|
||||
CoreRadius = Settings.CoreRadius.Evaluate(BodyData.Mass);
|
||||
RocheLimit = Settings.RocheLimit.Evaluate(BodyData.Mass);
|
||||
if (!(WellStrength >= 0f) || float.IsInfinity(WellStrength))
|
||||
throw new InvalidOperationException("A body's well strength must be finite and not negative (PlanetSettings.WellStrength).");
|
||||
if (WellStrength > 0 && !(0 < CoreRadius && CoreRadius < RocheLimit))
|
||||
throw new InvalidOperationException("A body's core radius must be positive and inside its Roche limit (PlanetSettings.CoreRadius, RocheLimit).");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue