fixed more nosecone display issues

This commit is contained in:
Daniel_M_Williams 2015-06-25 19:31:36 -04:00
parent df5b213d44
commit 02cc32eb6e
2 changed files with 14 additions and 11 deletions

View File

@ -36,6 +36,7 @@ public class SymmetricComponentShapes extends RocketComponentShape {
final double delta = 0.0000001; final double delta = 0.0000001;
double x; double x;
ArrayList<Coordinate> points = new ArrayList<Coordinate>(); ArrayList<Coordinate> points = new ArrayList<Coordinate>();
x = delta; x = delta;
points.add(new Coordinate(x, c.getRadius(x), 0)); points.add(new Coordinate(x, c.getRadius(x), 0));
@ -86,16 +87,18 @@ public class SymmetricComponentShapes extends RocketComponentShape {
//System.out.println("here"); //System.out.println("here");
Coordinate center = instanceOffset;
// TODO: LOW: curved path instead of linear // TODO: LOW: curved path instead of linear
Path2D.Double path = new Path2D.Double(); Path2D.Double path = new Path2D.Double();
path.moveTo(points.get(len - 1).x * scaleFactor, points.get(len - 1).y * scaleFactor); path.moveTo(points.get(len - 1).x * scaleFactor, (center.y+points.get(len - 1).y) * scaleFactor);
for (i = len - 2; i >= 0; i--) { for (i = len - 2; i >= 0; i--) {
path.lineTo(points.get(i).x * scaleFactor, points.get(i).y * scaleFactor); path.lineTo(points.get(i).x * scaleFactor, (center.y+points.get(i).y) * scaleFactor);
} }
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
path.lineTo(points.get(i).x * scaleFactor, -points.get(i).y * scaleFactor); path.lineTo(points.get(i).x * scaleFactor, (center.y-points.get(i).y) * scaleFactor);
} }
path.lineTo(points.get(len - 1).x * scaleFactor, points.get(len - 1).y * scaleFactor); path.lineTo(points.get(len - 1).x * scaleFactor, (center.y+points.get(len - 1).y) * scaleFactor);
path.closePath(); path.closePath();
//s[len] = path; //s[len] = path;

View File

@ -57,18 +57,19 @@ public class TransitionShapes extends RocketComponentShape {
if (transition.getForeShoulderLength() > 0.0005) { if (transition.getForeShoulderLength() > 0.0005) {
Coordinate start = transformation.transform(transition. Coordinate start = transformation.transform(transition.
toAbsolute(Coordinate.NUL)[0]); toAbsolute(instanceOffset)[0]);
double r = transition.getForeShoulderRadius(); double r = transition.getForeShoulderRadius();
double l = transition.getForeShoulderLength(); double l = transition.getForeShoulderLength();
shoulder1 = new Rectangle2D.Double((start.x-l)* scaleFactor, -r* scaleFactor, l* scaleFactor, 2*r* scaleFactor); shoulder1 = new Rectangle2D.Double((start.x-l)* scaleFactor, (start.y-r)* scaleFactor, l* scaleFactor, 2*r* scaleFactor);
arrayLength++; arrayLength++;
} }
if (transition.getAftShoulderLength() > 0.0005) { if (transition.getAftShoulderLength() > 0.0005) {
Coordinate start = transformation.transform(transition. Coordinate start = transformation.transform(transition.
toAbsolute(new Coordinate(transition.getLength()))[0]); toAbsolute(instanceOffset.add(transition.getLength(),0, 0))[0]);
double r = transition.getAftShoulderRadius(); double r = transition.getAftShoulderRadius();
double l = transition.getAftShoulderLength(); double l = transition.getAftShoulderLength();
shoulder2 = new Rectangle2D.Double(start.x* scaleFactor, -r* scaleFactor, l* scaleFactor, 2*r* scaleFactor); shoulder2 = new Rectangle2D.Double(start.x* scaleFactor, (start.y-r)* scaleFactor, l* scaleFactor, 2*r* scaleFactor);
arrayLength++; arrayLength++;
} }
if (shoulder1==null && shoulder2==null) if (shoulder1==null && shoulder2==null)
@ -102,11 +103,10 @@ public class TransitionShapes extends RocketComponentShape {
double r2 = transition.getAftRadius(); double r2 = transition.getAftRadius();
Coordinate center = instanceOffset; Coordinate center = instanceOffset;
// adjust center heree... somehow
Shape[] s = new Shape[2]; Shape[] s = new Shape[2];
s[0] = new Ellipse2D.Double(-r1*S,-r1*S,2*r1*S,2*r1*S); s[0] = new Ellipse2D.Double((center.z-r1)*S,(center.y-r1)*S,2*r1*S,2*r1*S);
s[1] = new Ellipse2D.Double(-r2*S,-r2*S,2*r2*S,2*r2*S); s[1] = new Ellipse2D.Double((center.z-r2)*S,(center.y-r2)*S,2*r2*S,2*r2*S);
return RocketComponentShape.toArray(s, component); return RocketComponentShape.toArray(s, component);
} }