mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Added ocean object
This commit is contained in:
@@ -39,6 +39,7 @@ public class GameView3D {
|
||||
root3D, 1000, 1000, true, SceneAntialiasing.BALANCED
|
||||
);
|
||||
view.setCamera(camera);
|
||||
view.setFill(Color.SKYBLUE);
|
||||
Sphere s = new Sphere(1);
|
||||
s.setMaterial(new PhongMaterial(Color.RED));
|
||||
Sphere left = new Sphere(1);
|
||||
@@ -72,7 +73,13 @@ public class GameView3D {
|
||||
Node coin = ModelFactory.importModel(ModelType.VELOCITY_COIN).getAssets();
|
||||
coin.setTranslateX(coin.getTranslateX() - 30);
|
||||
|
||||
gameObjects.getChildren().addAll(s, left, right, top, bottom, boat, boat2, boat3, sMarker, fMarker, marker, coin);
|
||||
gameObjects.getChildren().addAll(
|
||||
ModelFactory.importModel(ModelType.OCEAN).getAssets(),
|
||||
s, left, right, top, bottom,
|
||||
boat, boat2, boat3,
|
||||
sMarker, fMarker, marker,
|
||||
coin
|
||||
);
|
||||
view.sceneProperty().addListener((obs, old, scene) -> {
|
||||
if (scene!=null)
|
||||
enableCameraMovement(scene);
|
||||
|
||||
@@ -6,13 +6,11 @@ import javafx.animation.AnimationTimer;
|
||||
import javafx.geometry.Point3D;
|
||||
import javafx.scene.AmbientLight;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.PhongMaterial;
|
||||
import javafx.scene.shape.MeshView;
|
||||
import javafx.scene.transform.Rotate;
|
||||
import javafx.scene.transform.Scale;
|
||||
import seng302.model.token.TokenType;
|
||||
|
||||
/**
|
||||
* Factory class for creating 3D models of boats.
|
||||
@@ -89,6 +87,8 @@ public class ModelFactory {
|
||||
case PLAIN_MARKER:
|
||||
case START_MARKER:
|
||||
return makeMarker(assets);
|
||||
case OCEAN:
|
||||
return makeOcean(assets);
|
||||
default:
|
||||
return new Model(assets, null);
|
||||
}
|
||||
@@ -121,4 +121,10 @@ public class ModelFactory {
|
||||
area.getTransforms().add(new Rotate(90, new Point3D(1, 0, 0)));
|
||||
return new Model(area, null);
|
||||
}
|
||||
|
||||
private static Model makeOcean(Group plane) {
|
||||
plane.setScaleY(100);
|
||||
plane.setScaleX(100);
|
||||
return new Model(plane, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ public enum ModelType {
|
||||
FINISH_MARKER ("finish_marker.dae"),
|
||||
START_MARKER ("start_marker.dae"),
|
||||
PLAIN_MARKER ("plain_marker.dae"),
|
||||
MARK_AREA ("mark_area.dae");
|
||||
MARK_AREA ("mark_area.dae"),
|
||||
OCEAN ("ocean.dae");
|
||||
|
||||
final String filename;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user