Fixed parrot

This commit is contained in:
Calum
2017-09-28 14:28:07 +13:00
parent 8d74c3b756
commit 7cfad28d6b
2 changed files with 11 additions and 8 deletions
@@ -93,23 +93,26 @@ public class ModelFactory {
Group boatAssets = new Group(); Group boatAssets = new Group();
MeshView hull = importBoatSTL(boatType.hullFile); MeshView hull = importBoatSTL(boatType.hullFile);
hull.setMaterial(new PhongMaterial(primaryColour)); hull.setMaterial(new PhongMaterial(primaryColour));
MeshView sail = importBoatSTL(boatType.sailFile); boatAssets.getChildren().add(hull);
sail.setMaterial(
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.BLACK : Color.WHITE)
);
boatAssets.getChildren().addAll(hull, sail);
if (boatType.mastFile != null) { if (boatType.mastFile != null) {
MeshView mast = importBoatSTL(boatType.mastFile); MeshView mast = importBoatSTL(boatType.mastFile);
mast.setMaterial(new PhongMaterial(primaryColour)); mast.setMaterial(new PhongMaterial(primaryColour));
boatAssets.getChildren().add(mast); boatAssets.getChildren().add(mast);
} else {
boatAssets.getChildren().add(new Group());
} }
MeshView sail = importBoatSTL(boatType.sailFile);
sail.setMaterial(
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.DARKGRAY : Color.WHITE)
);
boatAssets.getChildren().add(sail);
if (boatType.jibFile != null) { if (boatType.jibFile != null) {
MeshView jib = importBoatSTL(boatType.jibFile); MeshView jib = importBoatSTL(boatType.jibFile);
sail.setMaterial( jib.setMaterial(
new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.DARKGRAY : Color.WHITE) new PhongMaterial(boatType == BoatMeshType.PARROT ? Color.BLACK : Color.WHITE)
); );
boatAssets.getChildren().add(jib); boatAssets.getChildren().add(jib);
} }