[fix][mass] Added a negative-mass check, which rarely happens during inconstitent component updates -- during scaling

This commit is contained in:
Daniel_M_Williams 2020-08-01 11:56:53 -04:00
parent 834f4763f5
commit 4825c7a1ee

View File

@ -1930,7 +1930,7 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
protected static final double ringMass(double outerRadius, double innerRadius,
double length, double density) {
return Math.PI * (MathUtil.pow2(outerRadius) - MathUtil.pow2(innerRadius)) *
return Math.PI * Math.max(MathUtil.pow2(outerRadius) - MathUtil.pow2(innerRadius),0) *
length * density;
}