- Added circle to boat to indicate which boat is the players and to show where the arrow is pointing.

#tags [1276]
This commit is contained in:
alistairjmcintyre
2017-09-27 21:31:02 +13:00
parent be72062c8e
commit c5e6302f86
5 changed files with 119 additions and 5 deletions
@@ -32,7 +32,6 @@ import seng302.model.mark.CompoundMark;
import seng302.model.mark.Corner; import seng302.model.mark.Corner;
import seng302.model.mark.Mark; import seng302.model.mark.Mark;
import seng302.model.token.Token; import seng302.model.token.Token;
import seng302.model.token.TokenType;
import seng302.utilities.GeoUtility; import seng302.utilities.GeoUtility;
import seng302.utilities.Sounds; import seng302.utilities.Sounds;
import seng302.visualiser.cameras.ChaseCamera; import seng302.visualiser.cameras.ChaseCamera;
@@ -31,6 +31,7 @@ public class BoatObject extends Group {
private BoatModel boatAssets; private BoatModel boatAssets;
private Group wake; private Group wake;
private Group markIndicator; private Group markIndicator;
private Group playerIndicator;
private Color colour = Color.BLACK; private Color colour = Color.BLACK;
private Boolean isSelected = false; private Boolean isSelected = false;
private Rotate rotation = new Rotate(0, new Point3D(0,0,1)); private Rotate rotation = new Rotate(0, new Point3D(0,0,1));
@@ -93,8 +94,8 @@ public class BoatObject extends Group {
Double angle = Math.toDegrees( Double angle = Math.toDegrees(
Math.atan2(boatLoc.getY() - markPoint.getY(), boatLoc.getX() - markPoint.getX())) - 90; Math.atan2(boatLoc.getY() - markPoint.getY(), boatLoc.getX() - markPoint.getX())) - 90;
Double radius = 3.0; Double radius = 2.7;
Double scale = 0.4; Double scale = 0.5;
Double originX = this.getLayoutX(); Double originX = this.getLayoutX();
Double originY = this.getLayoutY(); Double originY = this.getLayoutY();
@@ -106,7 +107,7 @@ public class BoatObject extends Group {
markIndicator.getTransforms().clear(); markIndicator.getTransforms().clear();
markIndicator.getTransforms().addAll( markIndicator.getTransforms().addAll(
new Rotate(angle, new Point3D(0, 0, 1)), new Rotate(angle, new Point3D(0, 0, 1)),
new Translate(0, -3, -0.1), new Translate(0, -radius, -0.1),
new Scale(scale, scale, scale / 3) new Scale(scale, scale, scale / 3)
); );
} }
@@ -153,6 +154,13 @@ public class BoatObject extends Group {
public void setMarkIndicator(Group indicator) { public void setMarkIndicator(Group indicator) {
this.markIndicator = indicator; this.markIndicator = indicator;
this.getChildren().add(markIndicator); this.getChildren().add(markIndicator);
Model torus = ModelFactory.importModel(ModelType.PLAYER_IDENTIFIER_TORUS);
torus.getAssets().getTransforms().addAll(
new Rotate(90, new Point3D(1, 0, 0)),
new Scale(0.7, 0.7, 0.7),
new Translate(0, 0, 0)
);
this.getChildren().add(torus.getAssets());
} }
public Group getWake () { public Group getWake () {
@@ -154,6 +154,8 @@ public class ModelFactory {
assets.setCacheHint(CacheHint.SCALE_AND_ROTATE); assets.setCacheHint(CacheHint.SCALE_AND_ROTATE);
} }
switch (tokenType) { switch (tokenType) {
case PLAYER_IDENTIFIER_TORUS:
return makeIdentifierTorus(assets);
case NEXT_MARK_INDICATOR: case NEXT_MARK_INDICATOR:
return makeNextMarkIndicator(assets); return makeNextMarkIndicator(assets);
case VELOCITY_PICKUP: case VELOCITY_PICKUP:
@@ -190,6 +192,11 @@ public class ModelFactory {
} }
} }
private static Model makeIdentifierTorus(Group assets) {
assets.getChildren().add(new AmbientLight());
return new Model(new Group(assets), null);
}
private static Model makeNextMarkIndicator(Group assets) { private static Model makeNextMarkIndicator(Group assets) {
assets.getChildren().add(new AmbientLight()); assets.getChildren().add(new AmbientLight());
return new Model(new Group(assets), null); return new Model(new Group(assets), null);
@@ -27,7 +27,8 @@ public enum ModelType {
PLAIN_ARROW ("arrow.dae"), PLAIN_ARROW ("arrow.dae"),
START_ARROW ("start_arrow.dae"), START_ARROW ("start_arrow.dae"),
FINISH_ARROW("finish_arrow.dae"), FINISH_ARROW("finish_arrow.dae"),
NEXT_MARK_INDICATOR("indicator_arrow.dae"); NEXT_MARK_INDICATOR("indicator_arrow.dae"),
PLAYER_IDENTIFIER_TORUS("torus.dae");
final String filename; final String filename;
File diff suppressed because one or more lines are too long