From 05b3052fb06aceea14b8aec17d9ca488287c40da Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Wed, 23 May 2012 14:47:46 +0000 Subject: [PATCH] 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. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@715 180e2498-e6e9-4542-8430-84ac67f01cd8 --- .../sf/openrocket/rocketcomponent/SymmetricComponent.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/SymmetricComponent.java b/core/src/net/sf/openrocket/rocketcomponent/SymmetricComponent.java index 7473b442..3c80ba6c 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/SymmetricComponent.java +++ b/core/src/net/sf/openrocket/rocketcomponent/SymmetricComponent.java @@ -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 ); } } -- 2.47.2