X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fsimulation%2FMassData.java;h=74386364d3ffc07369dc7f0bd7493afae5c9cff4;hb=d986f8cf502d63b32f57189b1c9e9825ef19dc86;hp=1d910df0a751f0a0e1edfe84f8647002c4697115;hpb=6200d1028c54fc15a2e332e3ab6137cf6886ea3a;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/simulation/MassData.java b/core/src/net/sf/openrocket/simulation/MassData.java index 1d910df0..74386364 100644 --- a/core/src/net/sf/openrocket/simulation/MassData.java +++ b/core/src/net/sf/openrocket/simulation/MassData.java @@ -13,15 +13,17 @@ public class MassData { private final Coordinate cg; private final double longitudinalInertia; private final double rotationalInertia; + private final double propellantMass; - public MassData(Coordinate cg, double longitudinalInertia, double rotationalInertia) { + public MassData(Coordinate cg, double longitudinalInertia, double rotationalInertia, double propellantMass) { if (cg == null) { throw new IllegalArgumentException("cg is null"); } this.cg = cg; this.longitudinalInertia = longitudinalInertia; this.rotationalInertia = rotationalInertia; + this.propellantMass = propellantMass; } @@ -39,6 +41,9 @@ public class MassData { return rotationalInertia; } + public double getPropellantMass() { + return propellantMass; + } @Override @@ -50,20 +55,20 @@ public class MassData { MassData other = (MassData) obj; return (this.cg.equals(other.cg) && MathUtil.equals(this.longitudinalInertia, other.longitudinalInertia) && - MathUtil.equals(this.rotationalInertia, other.rotationalInertia)); + MathUtil.equals(this.rotationalInertia, other.rotationalInertia)) && MathUtil.equals(this.propellantMass, other.propellantMass) ; } @Override public int hashCode() { - return (int) (cg.hashCode() ^ Double.doubleToLongBits(longitudinalInertia) ^ Double.doubleToLongBits(rotationalInertia)); + return (int) (cg.hashCode() ^ Double.doubleToLongBits(longitudinalInertia) ^ Double.doubleToLongBits(rotationalInertia) ^ Double.doubleToLongBits(propellantMass) ); } @Override public String toString() { return "MassData [cg=" + cg + ", longitudinalInertia=" + longitudinalInertia - + ", rotationalInertia=" + rotationalInertia + "]"; + + ", rotationalInertia=" + rotationalInertia + ", propellantMass="+propellantMass + "]"; } }