Merge branch 'master' into nightmode
This commit is contained in:
@@ -76,6 +76,9 @@ public class InGameLobbyController extends Controller {
|
||||
@FXML
|
||||
private Button startButton;
|
||||
|
||||
@FXML
|
||||
private GridPane animatedPane;
|
||||
|
||||
@FXML
|
||||
private Button quitButton;
|
||||
|
||||
@@ -110,6 +113,60 @@ public class InGameLobbyController extends Controller {
|
||||
importer.read(asset);
|
||||
lobbyUpdateListener = new PopulatePlayers();
|
||||
|
||||
AmbientLight ambientLight = new AmbientLight(Color.web("#888888"));
|
||||
ambientLight.setTranslateX(250);
|
||||
ambientLight.setTranslateZ(210);
|
||||
ambientLight.setLightOn(true);
|
||||
|
||||
PointLight pointLight = new PointLight(Color.web("#888888"));
|
||||
pointLight.setTranslateX(250);
|
||||
pointLight.setTranslateZ(210);
|
||||
pointLight.setLightOn(true);
|
||||
|
||||
ObservableList<Subject3D> subjects = FXCollections.observableArrayList();
|
||||
View3D view3D = new View3D();
|
||||
view3D.addAmbientLight(ambientLight);
|
||||
view3D.addPointLight(pointLight);
|
||||
view3D.setDistance(10);
|
||||
view3D.setPitch(5);
|
||||
view3D.setItems(subjects);
|
||||
|
||||
SkyBox skyBox = new SkyBox(750,200,250,0,250);
|
||||
subjects.addAll(skyBox.getSkyBoxPlanes());
|
||||
|
||||
SeaSurface seaSurface = new SeaSurface(750, 200);
|
||||
seaSurface.setX(250);
|
||||
seaSurface.setZ(250);
|
||||
subjects.add(seaSurface);
|
||||
|
||||
asset = RaceViewController.class.getClassLoader().getResource("assets/V1.2 Complete Boat.stl");
|
||||
StlMeshImporter importer = new StlMeshImporter();
|
||||
importer.read(asset);
|
||||
Subject3D boat = new Subject3D(new MeshView(importer.getImport()), 0);
|
||||
|
||||
double radius = 100;
|
||||
boat.setX(0);
|
||||
boat.setZ(radius);
|
||||
boat.setScale(0.1);
|
||||
|
||||
subjects.add(boat);
|
||||
view3D.trackSubject(boat, -45);
|
||||
|
||||
animatedPane.add(view3D, 0, 0);
|
||||
|
||||
AnimationTimer loop = new AnimationTimer() {
|
||||
double angle = -90;
|
||||
double offset = 0.05;
|
||||
@Override
|
||||
public void handle(long now) {
|
||||
boat.setX(radius * Math.cos(angle * Math.PI/180));
|
||||
boat.setZ(radius * Math.sin(angle * Math.PI/180));
|
||||
boat.setHeading(-angle);
|
||||
angle += offset;
|
||||
}
|
||||
};
|
||||
loop.start();
|
||||
|
||||
}
|
||||
|
||||
private void resetLobby(){
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<AnchorPane fx:id="gameLobbyWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.InGameLobbyController">
|
||||
<AnchorPane fx:id="gameLobbyWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.InGameLobbyController">
|
||||
<children>
|
||||
<GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
@@ -82,5 +93,17 @@
|
||||
<RowConstraints maxHeight="80.0" minHeight="80.0" prefHeight="80.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
<AnchorPane mouseTransparent="true" opacity="0.3" prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: rgba(0, 0, 0, 1);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<GridPane fx:id="animatedPane" opacity="0.42" style="-fx-background-color: rgba(0, 0, 0, 0.5);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
||||
Reference in New Issue
Block a user