[#2217] Whoops, my bad, component volume is for all instances

This commit is contained in:
SiboVG 2023-05-23 21:17:31 +02:00
parent 7956867dd9
commit d58b856acc
3 changed files with 4 additions and 3 deletions

View File

@ -102,7 +102,7 @@ public abstract class ExternalComponent extends RocketComponent {
*/
@Override
public double getComponentMass() {
return material.getDensity() * getComponentVolume() * getInstanceCount();
return material.getDensity() * getComponentVolume();
}
/**

View File

@ -215,7 +215,7 @@ public class LaunchLug extends Tube implements AnglePositionable, BoxBounded, Li
@Override
public double getComponentVolume() {
return length * Math.PI * (MathUtil.pow2(radius) - MathUtil.pow2(radius - thickness));
return length * Math.PI * (MathUtil.pow2(radius) - MathUtil.pow2(radius - thickness)) * getInstanceCount();
}
@Override

View File

@ -304,7 +304,8 @@ public class RailButton extends ExternalComponent implements AnglePositionable,
final double volInner = Math.PI*Math.pow( innerDiameter_m/2, 2)*getInnerHeight();
final double volStandoff = Math.PI*Math.pow( outerDiameter_m/2, 2)* baseHeight_m;
final double volScrew = 2f/3 * Math.PI * MathUtil.pow2(outerDiameter_m/2) * screwHeight_m;
return volOuter + volInner + volStandoff + volScrew;
final double volInstance = volOuter + volInner + volStandoff + volScrew;
return volInstance * getInstanceCount();
}
@Override