mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Added ocean asset. Moved camera to center of race.
#story[1266]
This commit is contained in:
@@ -5,10 +5,10 @@ import com.interactivemesh.jfx.importer.stl.StlMeshImporter;
|
||||
import javafx.animation.AnimationTimer;
|
||||
import javafx.geometry.Point3D;
|
||||
import javafx.scene.AmbientLight;
|
||||
import javafx.scene.CacheHint;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.PhongMaterial;
|
||||
import javafx.scene.shape.Circle;
|
||||
import javafx.scene.shape.MeshView;
|
||||
import javafx.scene.transform.Rotate;
|
||||
import javafx.scene.transform.Scale;
|
||||
@@ -56,7 +56,7 @@ public class ModelFactory {
|
||||
Group boatAssets = getUnmodifiedBoatModel(boatType, primaryColour);
|
||||
boatAssets.getTransforms().setAll(
|
||||
new Rotate(-90, new Point3D(0,0,1)),
|
||||
new Scale(0.05, 0.05, 0.05)
|
||||
new Scale(0.06, 0.06, 0.06)
|
||||
);
|
||||
return new BoatModel(boatAssets, null, boatType);
|
||||
}
|
||||
@@ -76,6 +76,9 @@ public class ModelFactory {
|
||||
private static MeshView importFile(String fileName) {
|
||||
StlMeshImporter importer = new StlMeshImporter();
|
||||
importer.read(ModelFactory.class.getResource("/meshes/" + fileName));
|
||||
MeshView importedFile = new MeshView(importer.getImport());
|
||||
importedFile.setCache(true);
|
||||
importedFile.setCacheHint(CacheHint.SCALE_AND_ROTATE);
|
||||
return new MeshView(importer.getImport());
|
||||
}
|
||||
|
||||
@@ -87,6 +90,8 @@ public class ModelFactory {
|
||||
ColModelImporter importer = new ColModelImporter();
|
||||
importer.read(ModelFactory.class.getResource("/meshes/" + tokenType.filename));
|
||||
assets = new Group(importer.getImport());
|
||||
assets.setCache(true);
|
||||
assets.setCacheHint(CacheHint.SCALE_AND_ROTATE);
|
||||
}
|
||||
switch (tokenType) {
|
||||
case VELOCITY_PICKUP:
|
||||
@@ -145,11 +150,15 @@ public class ModelFactory {
|
||||
private static Model makeOcean(Group group) {
|
||||
// group.setScaleY(Double.MAX_VALUE);
|
||||
// group.setScaleX(Double.MAX_VALUE);
|
||||
// group.getTransforms().add(new Rotate(90, new Point3D(1, 0, 0)));
|
||||
Circle ocean = new Circle(0,0,1000, Color.DARKSEAGREEN);
|
||||
ocean.setStroke(Color.TRANSPARENT);
|
||||
group.getChildren().add(ocean);
|
||||
return new Model(group, null);
|
||||
group.getTransforms().addAll(
|
||||
new Rotate(90, new Point3D(1, 0, 0)),
|
||||
new Scale(10,4,10)
|
||||
);
|
||||
// group.getChildren().add(new AmbientLight());
|
||||
// Circle ocean = new Circle(0,0,500, Color.SKYBLUE);
|
||||
// ocean.setStroke(Color.TRANSPARENT);
|
||||
// group.getChildren().add(ocean);
|
||||
return new Model(new Group(group), null);
|
||||
}
|
||||
|
||||
private static Model makeBarrier(Group assets) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public enum ModelType {
|
||||
START_MARKER ("start_marker.dae"),
|
||||
PLAIN_MARKER ("plain_marker.dae"),
|
||||
MARK_AREA ("mark_area.dae"),
|
||||
OCEAN (null),
|
||||
OCEAN ("ocean.dae"),
|
||||
BORDER_PYLON ("barrier_pole.dae"),
|
||||
BORDER_BARRIER ("barrier_segment.dae"),
|
||||
FINISH_LINE ("finish_line.dae"),
|
||||
|
||||
Reference in New Issue
Block a user