From 778413c882c560171e58ca516b423cdea489c323 Mon Sep 17 00:00:00 2001 From: bweissinger Date: Sun, 1 Sep 2019 00:42:39 -0500 Subject: [PATCH] Correct InnerTube.getInstanceOffsets() returning Coordinate.ZERO instead of actual offset values --- .../net/sf/openrocket/rocketcomponent/InnerTube.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/InnerTube.java b/core/src/net/sf/openrocket/rocketcomponent/InnerTube.java index 3af29e6ff..0b21dcf3d 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/InnerTube.java +++ b/core/src/net/sf/openrocket/rocketcomponent/InnerTube.java @@ -217,12 +217,15 @@ public class InnerTube extends ThicknessRingComponent implements AxialPositionab @Override public Coordinate[] getInstanceOffsets(){ - if ( 1 == getInstanceCount()) - return new Coordinate[] { Coordinate.ZERO }; + if ( 1 == getInstanceCount()) { + double yOffset = this.radialPosition * Math.cos(this.radialDirection); + double zOffset = this.radialPosition * Math.sin(this.radialDirection); + return new Coordinate[] { Coordinate.ZERO.add(0.0, yOffset, zOffset) }; + } List points = getClusterPoints(); - return points.toArray( new Coordinate[ points.size()]); + return points.toArray( new Coordinate[ points.size() ]); } // @Override @@ -387,4 +390,4 @@ public class InnerTube extends ThicknessRingComponent implements AxialPositionab return this.motors.toDebug(); } -} \ No newline at end of file +}