Merge remote-tracking branch 'remotes/origin/master' into spectate_mode_basic

This commit is contained in:
hba56
2017-09-19 12:38:51 +12:00
9 changed files with 23 additions and 14 deletions
@@ -15,6 +15,7 @@ import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.MeshView;
import mock.app.Event;
import network.Messages.Enums.RaceStatusEnum;
@@ -144,6 +145,8 @@ public class InGameLobbyController extends Controller {
subjects.add(sea);
MeshView mesh = new MeshView(importer.getImport());
PhongMaterial boatColorMat = new PhongMaterial(boat.getColor());
mesh.setMaterial(boatColorMat);
Subject3D subject = new Subject3D(mesh,0);
subjects.add(subject);
@@ -161,7 +164,7 @@ public class InGameLobbyController extends Controller {
};
rotate.start();
allPlayerLabels.get(count).setText("Player: " + boat.getSourceID());
allPlayerLabels.get(count).setText(boat.getName());
allPlayerLabels.get(count).toFront();
count += 1;
if (count > 2){
@@ -305,6 +305,8 @@ public class RaceViewController extends Controller {
} else {
mesh = new MeshView(importerBurgerBoat.getImport());
}
PhongMaterial boatColorMat = new PhongMaterial(boat.getColor());
mesh.setMaterial(boatColorMat);
Subject3D boatModel = new Subject3D(mesh, boat.getSourceID());
viewSubjects.add(boatModel);
@@ -9,12 +9,12 @@ public class GraphCoordinate {
/**
* X (horizontal) coordinate.
*/
private final int x;
private final double x;
/**
* Y (vertical) coordinate.
*/
private final int y;
private final double y;
/**
* Constructor method.
@@ -22,7 +22,7 @@ public class GraphCoordinate {
* @param x X coordinate.
* @param y Y coordinate.
*/
public GraphCoordinate(int x, int y) {
public GraphCoordinate(double x, double y) {
this.x = x;
this.y = y;
}
@@ -33,7 +33,7 @@ public class GraphCoordinate {
*
* @return x axis Coordinate.
*/
public int getX() {
public double getX() {
return x;
}
@@ -42,7 +42,7 @@ public class GraphCoordinate {
*
* @return y axis Coordinate.
*/
public int getY() {
public double getY() {
return y;
}
@@ -239,8 +239,8 @@ public class ResizableRaceCanvas extends ResizableCanvas {
//Offset by 20 pixels horizontally.
long xCoord = coordinate.getX() + 20;
long yCoord = coordinate.getY();
double xCoord = coordinate.getX() + 20;
double yCoord = coordinate.getY();
//If the text would extend out of the canvas (to the right), move it left.
if (xCoord + (text.length() * 7) >= getWidth()) {
@@ -26,6 +26,7 @@ public class MatchBrowserInterface {
public MatchBrowserInterface() {
try {//132.181.16.13 is the ip of the CI as of 13/9/17
//this.IPAddress = InetAddress.getByName("umbrasheep.com"); //InetAddress.getLocalHost();
this.IPAddress = InetAddress.getByName("132.181.16.13"); //InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
@@ -67,8 +67,8 @@ public class GPSConverter {
//Calculate the x and y pixel coordinates.
//We take the complement of latProportion to flip it.
int x = (int) (longProportion * smallerDimension);
int y = (int) (latProportion * smallerDimension);
double x = (longProportion * smallerDimension);
double y = (latProportion * smallerDimension);
//Because we try to maintain the correct aspect ratio, we will end up with "spare" pixels along the larger dimension (e.g., width 800, height 600, 200 extra pixels along width).
double extraDistance = Math.abs(longitudeFactor - latitudeFactor);