Correct the computation of shape mass in integrate() by computing the mass based...
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Wed, 23 May 2012 14:47:46 +0000 (14:47 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Wed, 23 May 2012 14:47:46 +0000 (14:47 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@715 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/rocketcomponent/SymmetricComponent.java

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