Correct the computation of shape mass in integrate() by computing the mass based on the integrated volume * density instead of using the super.getComponentMass(). super.getComponentMass() includes the mass of the shape as well as the shoulders.

This commit is contained in:
Kevin Ruland 2012-05-23 14:47:46 +00:00
parent 4abceb9185
commit 85f5194c6d

View File

@ -381,10 +381,10 @@ public abstract class SymmetricComponent extends BodyComponent implements Radial
volume = 0; volume = 0;
cg = new Coordinate(length / 2, 0, 0, 0); cg = new Coordinate(length / 2, 0, 0, 0);
} else { } else {
// getComponentMass is safe now // the mass of this shape is the material density * volume.
// Use super.getComponentMass() to ensure only the transition shape mass // it cannot come from super.getComponentMass() since that
// is used, not the shoulders // includes the shoulders
cg = new Coordinate(cgx / volume, 0, 0, super.getComponentMass()); cg = new Coordinate(cgx / volume, 0, 0, getMaterial().getDensity() * volume );
} }
} }