mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed position issues on entry arrows.
#implement #story[1266] #fix
This commit is contained in:
@@ -590,7 +590,7 @@ public class GameView3D {
|
||||
new Scale(1, lastLocation.distance(location) / 5, 1)
|
||||
);
|
||||
trail.getChildren().add(segment);
|
||||
if (trail.getChildren().size() > 100) {
|
||||
if (trail.getChildren().size() > 50) {
|
||||
trail.getChildren().remove(0);
|
||||
}
|
||||
lastLocation = location;
|
||||
|
||||
@@ -86,6 +86,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
private Label timerLabel;
|
||||
@FXML
|
||||
private StackPane contentAnchorPane;
|
||||
|
||||
private GridPane contentGridPane;
|
||||
@FXML
|
||||
private AnchorPane rvAnchorPane;
|
||||
|
||||
@@ -6,6 +6,7 @@ import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.shape.Arc;
|
||||
import javafx.scene.shape.ArcType;
|
||||
import javafx.scene.shape.Circle;
|
||||
import javafx.scene.shape.Polygon;
|
||||
import javafx.scene.shape.Polyline;
|
||||
import javafx.scene.shape.StrokeLineCap;
|
||||
@@ -38,31 +39,46 @@ public class MarkArrowFactory {
|
||||
public static Model constructEntryArrow3D (
|
||||
RoundingSide roundingSide, double angle, ModelType type) {
|
||||
Model entryArrow = ModelFactory.importModel(type);
|
||||
|
||||
double angleDeg = angle;
|
||||
angle = 180 - angle;
|
||||
angle = Math.toRadians(angle);
|
||||
|
||||
int multiplier = roundingSide == RoundingSide.STARBOARD ? 1 : -1;
|
||||
double relativeX = multiplier * 10 * Math.sin(angle + Math.PI / 8);
|
||||
double relativeY = multiplier * 10 * Math.cos(angle + Math.PI / 8);
|
||||
double xStart = relativeX + multiplier * 10 * Math.sin(angle - Math.PI / 2);
|
||||
double yStart = relativeY + multiplier * 10 * Math.cos(angle - Math.PI / 2);
|
||||
double relativeX = multiplier * 5.7 * Math.sin(angle + Math.PI / 2);
|
||||
double relativeY = multiplier * 5.7 * Math.cos(angle + Math.PI / 2);
|
||||
double xStart = relativeX + multiplier * 8 * Math.sin(angle + Math.PI);
|
||||
double yStart = relativeY + multiplier * 8 * Math.cos(angle + Math.PI);
|
||||
entryArrow.getAssets().getTransforms().addAll(
|
||||
new Translate(xStart, yStart, 0),
|
||||
new Rotate(Math.toDegrees(angle), new Point3D(0,0,1))
|
||||
new Rotate(angleDeg, new Point3D(0,0,1))
|
||||
);
|
||||
return entryArrow;
|
||||
Circle c = new Circle(relativeX, relativeY, 1, Color.RED);
|
||||
Circle v = new Circle(xStart, yStart, 1, Color.BLUE);
|
||||
return new Model(new Group(c, v, entryArrow.getAssets()), null);
|
||||
}
|
||||
|
||||
public static Model constructExitArrow3D (
|
||||
RoundingSide roundingSide, double angle, ModelType type) {
|
||||
Model exitArrow = ModelFactory.importModel(type);
|
||||
|
||||
double angleDeg = angle;
|
||||
angle = 180 - angle;
|
||||
angle = Math.toRadians(angle);
|
||||
|
||||
int multiplier = roundingSide == RoundingSide.STARBOARD ? 1 : -1;
|
||||
double xStart = multiplier * 6 * Math.sin(angle + Math.PI / 8);
|
||||
double yStart = multiplier * 6 * Math.cos(angle + Math.PI / 8);
|
||||
double xStart = multiplier * 5.7 * Math.sin(angle + Math.PI / 2);
|
||||
double yStart = multiplier * 5.7 * Math.cos(angle + Math.PI / 2);
|
||||
|
||||
exitArrow.getAssets().getTransforms().addAll(
|
||||
new Translate(xStart, yStart, 0),
|
||||
new Rotate(Math.toDegrees(angle), new Point3D(0,0,1))
|
||||
new Rotate(angleDeg, new Point3D(0,0,1))
|
||||
);
|
||||
return exitArrow;
|
||||
Circle c = new Circle(xStart, yStart, 1, Color.RED);
|
||||
if (roundingSide == RoundingSide.PORT) {
|
||||
c = new Circle(xStart, yStart, 1, Color.GREENYELLOW);
|
||||
}
|
||||
return new Model(new Group(c, exitArrow.getAssets()), null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,11 +14,8 @@
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<AnchorPane fx:id="rvAnchorPane" maxHeight="1.7976931348623157E308"
|
||||
maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0"
|
||||
prefWidth="1200.0" style="-fx-background-color: skyblue;" xmlns="http://javafx.com/javafx/8"
|
||||
xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="seng302.visualiser.controllers.RaceViewController">
|
||||
|
||||
<AnchorPane fx:id="rvAnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" style="-fx-background-color: lightblue;" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.visualiser.controllers.RaceViewController">
|
||||
<children>
|
||||
<StackPane fx:id="contentAnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="800.0" prefWidth="1200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
|
||||
@@ -32,15 +29,13 @@
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="70.0" minHeight="70.0" prefHeight="70.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="1.7976931348623157E308" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="250.0" minHeight="250.0" prefHeight="250.0"
|
||||
valignment="BOTTOM" vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="250.0" minHeight="250.0" prefHeight="250.0" valignment="BOTTOM" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<GridPane id="timerGrid" fx:id="timerGrid" prefWidth="192.0" styleClass="timer">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="135.0" minWidth="135.0"
|
||||
prefWidth="135.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="135.0" minWidth="135.0" prefWidth="135.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
@@ -81,17 +76,14 @@
|
||||
</GridPane>
|
||||
<GridPane fx:id="chatGridPane" GridPane.columnIndex="2" GridPane.rowIndex="2">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="390.0" minWidth="390.0"
|
||||
prefWidth="390.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="390.0" minWidth="390.0" prefWidth="390.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="1.7976931348623157E308" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="60.0" minHeight="60.0" prefHeight="60.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="60.0" minHeight="60.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Pane fx:id="chatHistoryHolder" prefHeight="200.0" prefWidth="200.0"
|
||||
GridPane.hgrow="ALWAYS" GridPane.valignment="BOTTOM" GridPane.vgrow="ALWAYS">
|
||||
<Pane fx:id="chatHistoryHolder" prefHeight="200.0" prefWidth="200.0" GridPane.hgrow="ALWAYS" GridPane.valignment="BOTTOM" GridPane.vgrow="ALWAYS">
|
||||
<GridPane.margin>
|
||||
<Insets />
|
||||
</GridPane.margin>
|
||||
@@ -101,45 +93,37 @@
|
||||
</Pane>
|
||||
<GridPane fx:id="chatInputHolder" GridPane.rowIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="90.0"
|
||||
prefWidth="90.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="90.0" prefWidth="90.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0"
|
||||
valignment="CENTER" vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0" valignment="CENTER" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<JFXButton fx:id="chatSend" alignment="CENTER" buttonType="RAISED"
|
||||
maxHeight="-Infinity" maxWidth="1.7976931348623157E308"
|
||||
minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0"
|
||||
text="SEND" GridPane.columnIndex="1">
|
||||
<JFXButton fx:id="chatSend" alignment="CENTER" buttonType="RAISED" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" text="SEND" GridPane.columnIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</GridPane.margin>
|
||||
</JFXButton>
|
||||
<JFXTextField fx:id="chatInput" maxHeight="35.0" minHeight="-Infinity"
|
||||
prefHeight="35.0">
|
||||
<JFXTextField fx:id="chatInput" maxHeight="35.0" minHeight="-Infinity" prefHeight="35.0">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="20.0" right="10.0"/>
|
||||
<Insets bottom="10.0" left="20.0" right="10.0" />
|
||||
</GridPane.margin>
|
||||
<padding>
|
||||
<Insets right="15.0"/>
|
||||
<Insets right="15.0" />
|
||||
</padding>
|
||||
</JFXTextField>
|
||||
</children>
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
<Insets top="10.0" />
|
||||
</GridPane.margin>
|
||||
</GridPane>
|
||||
</children>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" right="10.0"/>
|
||||
<Insets bottom="10.0" right="10.0" />
|
||||
</GridPane.margin>
|
||||
</GridPane>
|
||||
<GridPane fx:id="windGridPane" maxHeight="-Infinity" maxWidth="-Infinity"
|
||||
prefHeight="150.0" prefWidth="240.0" GridPane.halignment="CENTER"
|
||||
GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
|
||||
<GridPane fx:id="windGridPane" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="150.0" prefWidth="240.0" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0" prefWidth="110.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="132.0" minWidth="10.0" prefWidth="132.0" />
|
||||
|
||||
Reference in New Issue
Block a user