Added new Wind Waker mesh

#implement #story[1293]
This commit is contained in:
Calum
2017-09-28 00:24:34 +13:00
parent a1a34b9bd7
commit a266779709
6 changed files with 19 additions and 11 deletions
@@ -341,7 +341,7 @@ public class GameState implements Runnable {
private void spawnNewToken() { private void spawnNewToken() {
tokensInPlay.clear(); tokensInPlay.clear();
Token token = randomSpawn.getRandomToken(); Token token = randomSpawn.getRandomToken();
// token.assignType(TokenType.RANDOM); // token.assignType(TokenType.WIND_WALKER);
logger.debug("Spawned token of type " + token.getTokenType()); logger.debug("Spawned token of type " + token.getTokenType());
tokensInPlay.add(token); tokensInPlay.add(token);
MessageFactory.updateTokens(tokensInPlay); MessageFactory.updateTokens(tokensInPlay);
@@ -12,7 +12,8 @@ public enum BoatMeshType {
0.997, null, false, 1.0, 1.4, 2.0), 0.997, null, false, 1.0, 1.4, 2.0),
PIRATE_SHIP("pirateship_hull.stl", "pirateship_mast.stl", -0.5415, "pirateship_mainsail.stl", PIRATE_SHIP("pirateship_hull.stl", "pirateship_mast.stl", -0.5415, "pirateship_mainsail.stl",
-0.5415, "pirateship_frontsail.stl", true, 1.2, 1.6, 1.2), -0.5415, "pirateship_frontsail.stl", true, 1.2, 1.6, 1.2),
DUCKY("ducky_hull.stl", "ducky_mast.stl", -2.18539, "ducky_sail.stl", -2.18539, "ducky_eyes.stl", false, 1.2, 1.1, 1.4); DUCKY("ducky_hull.stl", "ducky_mast.stl", -2.18539, "ducky_sail.stl", -2.18539, "ducky_eyes.stl", false, 1.2, 1.1, 1.4),
PARROT("parrot_hull.stl", null, 0, "parrot_sail.stl", 0, "parrot_features.stl", true, 1, 1, 1);
final String hullFile, mastFile, sailFile, jibFile; final String hullFile, mastFile, sailFile, jibFile;
final double mastOffset, sailOffset; final double mastOffset, sailOffset;
@@ -20,7 +21,7 @@ public enum BoatMeshType {
public final double accelerationMultiplier; public final double accelerationMultiplier;
public final double turnStep; public final double turnStep;
final boolean fixedSail; final boolean fixedSail;
final static BoatMeshType[] boatTypes = new BoatMeshType[]{DINGHY, CATAMARAN, PIRATE_SHIP, DUCKY}; final static BoatMeshType[] boatTypes = new BoatMeshType[]{DINGHY, CATAMARAN, PIRATE_SHIP, DUCKY, PARROT};
BoatMeshType(String hullFile, String mastFile, double mastOffset, String sailFile, BoatMeshType(String hullFile, String mastFile, double mastOffset, String sailFile,
double sailOffset, String jibFile, boolean fixedSail, double maxSpeedMultiplier, double accelerationMultiplier, double turnStep) { double sailOffset, String jibFile, boolean fixedSail, double maxSpeedMultiplier, double accelerationMultiplier, double turnStep) {
@@ -7,7 +7,6 @@ import javafx.geometry.Point3D;
import javafx.scene.AmbientLight; import javafx.scene.AmbientLight;
import javafx.scene.CacheHint; import javafx.scene.CacheHint;
import javafx.scene.Group; import javafx.scene.Group;
import javafx.scene.PointLight;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial; import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.Circle; import javafx.scene.shape.Circle;
@@ -118,17 +117,25 @@ public class ModelFactory {
Group boatAssets = new Group(); Group boatAssets = new Group();
MeshView hull = importSTL(boatType.hullFile); MeshView hull = importSTL(boatType.hullFile);
hull.setMaterial(new PhongMaterial(primaryColour)); hull.setMaterial(new PhongMaterial(primaryColour));
MeshView mast = importSTL(boatType.mastFile);
mast.setMaterial(new PhongMaterial(primaryColour));
MeshView sail = importSTL(boatType.sailFile); MeshView sail = importSTL(boatType.sailFile);
sail.setMaterial(new PhongMaterial(Color.WHITE)); sail.setMaterial(
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.BLACK : Color.WHITE)
);
boatAssets.getChildren().addAll(hull, sail);
if (boatType.mastFile != null) {
MeshView mast = importSTL(boatType.mastFile);
mast.setMaterial(new PhongMaterial(primaryColour));
boatAssets.getChildren().add(mast);
}
if (boatType.jibFile != null) { if (boatType.jibFile != null) {
MeshView jib = importSTL(boatType.jibFile); MeshView jib = importSTL(boatType.jibFile);
sail.setMaterial(new PhongMaterial(Color.WHITE)); sail.setMaterial(
boatAssets.getChildren().addAll(hull, mast, sail, jib); new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.DARKGRAY : Color.WHITE)
} else { );
boatAssets.getChildren().addAll(hull, mast, sail); boatAssets.getChildren().add(jib);
} }
return boatAssets; return boatAssets;
Binary file not shown.
Binary file not shown.