[#2050] Fix carets rotation in top view
This commit is contained in:
parent
4113f023f8
commit
8a691759b7
@ -125,10 +125,17 @@ public class RocketFigure extends AbstractScaleFigure {
|
|||||||
updateFigure();
|
updateFigure();
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getRotation(boolean applyTopViewOffset) {
|
||||||
|
if (applyTopViewOffset && currentViewType == RocketPanel.VIEW_TYPE.TopView) {
|
||||||
|
return this.rotation - Math.PI/2;
|
||||||
|
} else {
|
||||||
|
return this.rotation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public double getRotation() {
|
public double getRotation() {
|
||||||
return rotation;
|
return getRotation(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRotation(double rot) {
|
public void setRotation(double rot) {
|
||||||
@ -142,7 +149,7 @@ public class RocketFigure extends AbstractScaleFigure {
|
|||||||
|
|
||||||
private Transformation getFigureRotation() {
|
private Transformation getFigureRotation() {
|
||||||
if (currentViewType == RocketPanel.VIEW_TYPE.TopView) {
|
if (currentViewType == RocketPanel.VIEW_TYPE.TopView) {
|
||||||
return this.axialRotation.applyTransformation(Transformation.rotate_x(-Math.PI / 2));
|
return this.axialRotation.applyTransformation(Transformation.rotate_x(-Math.PI/2));
|
||||||
} else {
|
} else {
|
||||||
return this.axialRotation;
|
return this.axialRotation;
|
||||||
}
|
}
|
||||||
@ -299,10 +306,8 @@ public class RocketFigure extends AbstractScaleFigure {
|
|||||||
Coordinate[] mountLocations = mount.getLocations();
|
Coordinate[] mountLocations = mount.getLocations();
|
||||||
|
|
||||||
double mountLength = mountComponent.getLength();
|
double mountLength = mountComponent.getLength();
|
||||||
// System.err.println("Drawing Motor: "+motor.getDesignation()+" (x"+mountLocations.length+")");
|
|
||||||
for (Coordinate curMountLocation : mountLocations) {
|
for (Coordinate curMountLocation : mountLocations) {
|
||||||
Coordinate curMotorLocation = curMountLocation.add(mountLength - motorLength + mount.getMotorOverhang(), 0, 0);
|
Coordinate curMotorLocation = curMountLocation.add(mountLength - motorLength + mount.getMotorOverhang(), 0, 0);
|
||||||
// System.err.println(String.format(" mount instance: %s => %s", curMountLocation.toString(), curMotorLocation.toString() ));
|
|
||||||
|
|
||||||
// rotate by figure's axial rotation:
|
// rotate by figure's axial rotation:
|
||||||
curMotorLocation = getFigureRotation().transform(curMotorLocation);
|
curMotorLocation = getFigureRotation().transform(curMotorLocation);
|
||||||
|
@ -732,7 +732,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
double cgy = Double.NaN;
|
double cgy = Double.NaN;
|
||||||
double cpx = Double.NaN;
|
double cpx = Double.NaN;
|
||||||
double cpy = Double.NaN;
|
double cpy = Double.NaN;
|
||||||
final double rotation = rotationModel.getValue();
|
final double rotation = figure.getRotation(true);
|
||||||
|
|
||||||
FlightConfiguration curConfig = document.getSelectedConfiguration();
|
FlightConfiguration curConfig = document.getSelectedConfiguration();
|
||||||
// TODO: MEDIUM: User-definable conditions
|
// TODO: MEDIUM: User-definable conditions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user