Fixed cat ate a meringue sail rotation.

#fix #story[1274]
This commit is contained in:
Calum
2017-09-20 16:42:26 +12:00
parent fe76e85c71
commit c5d56065b6
9 changed files with 5 additions and 7 deletions
@@ -7,8 +7,8 @@ package seng302.visualiser.fxObjects.assets_3D;
*/ */
public enum BoatMeshType { public enum BoatMeshType {
DINGHY ("dinghy_hull.stl", "dinghy_mast.stl", -1.36653, "dinghy_sail.stl", -1.36653), DINGHY ("dinghy_hull.stl", "dinghy_mast.stl", 1.36653, "dinghy_sail.stl", 1.36653),
CATAMARAN ("catamaran_hull.stl", "catamaran_mast.stl", -1.36845, "catamaran_sail.stl", -1.36845); CATAMARAN ("catamaran_hull.stl", "catamaran_mast.stl", 0.997, "catamaran_sail.stl", 0.997);
final String hullFile, mastFile, sailFile; final String hullFile, mastFile, sailFile;
final double mastOffset, sailOffset; final double mastOffset, sailOffset;
@@ -37,10 +37,10 @@ public class BoatModel extends Model {
MeshView mast = getMeshViewChild(MAST_INDEX); MeshView mast = getMeshViewChild(MAST_INDEX);
MeshView sail = getMeshViewChild(SAIL_INDEX); MeshView sail = getMeshViewChild(SAIL_INDEX);
mast.getTransforms().setAll( mast.getTransforms().setAll(
new Rotate(degrees, -meshType.mastOffset, 0,0, new Point3D(0, 0, 1)) new Rotate(degrees, 0, -meshType.mastOffset, 0, new Point3D(0, 0, 1))
); );
sail.getTransforms().setAll( sail.getTransforms().setAll(
new Rotate(degrees, -meshType.sailOffset, 0,0, new Point3D(0, 0, 1)) new Rotate(degrees, 0, -meshType.sailOffset,0, new Point3D(0, 0, 1))
); );
} }
@@ -28,7 +28,7 @@ public class BoatObject extends Group {
private Group wake; private Group wake;
private Color colour = Color.BLACK; private Color colour = Color.BLACK;
private Boolean isSelected = false; private Boolean isSelected = false;
private Rotate rotation = new Rotate(0,0,1); private Rotate rotation = new Rotate(0, new Point3D(0,0,1));
private List<SelectedBoatListener> selectedBoatListenerListeners = new ArrayList<>(); private List<SelectedBoatListener> selectedBoatListenerListeners = new ArrayList<>();
@@ -66,8 +66,6 @@ public class BoatObject extends Group {
* @param windDir . * @param windDir .
*/ */
public void moveTo(double x, double y, double rotation, double velocity, Boolean sailIn, double windDir) { public void moveTo(double x, double y, double rotation, double velocity, Boolean sailIn, double windDir) {
Double dx = Math.abs(boatAssets.getAssets().getLayoutX() - x);
Double dy = Math.abs(boatAssets.getAssets().getLayoutY() - y);
Platform.runLater(() -> { Platform.runLater(() -> {
rotateTo(rotation, sailIn, windDir); rotateTo(rotation, sailIn, windDir);
this.layoutXProperty().setValue(x); this.layoutXProperty().setValue(x);
Binary file not shown.
Binary file not shown.
Binary file not shown.