mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed position issues on first 2 mark arrows.
#implement #story[1266]
This commit is contained in:
@@ -6,7 +6,6 @@ import javafx.scene.paint.Color;
|
|||||||
import javafx.scene.paint.Paint;
|
import javafx.scene.paint.Paint;
|
||||||
import javafx.scene.shape.Arc;
|
import javafx.scene.shape.Arc;
|
||||||
import javafx.scene.shape.ArcType;
|
import javafx.scene.shape.ArcType;
|
||||||
import javafx.scene.shape.Circle;
|
|
||||||
import javafx.scene.shape.Polygon;
|
import javafx.scene.shape.Polygon;
|
||||||
import javafx.scene.shape.Polyline;
|
import javafx.scene.shape.Polyline;
|
||||||
import javafx.scene.shape.StrokeLineCap;
|
import javafx.scene.shape.StrokeLineCap;
|
||||||
@@ -39,33 +38,31 @@ public class MarkArrowFactory {
|
|||||||
public static Model constructEntryArrow3D (
|
public static Model constructEntryArrow3D (
|
||||||
RoundingSide roundingSide, double angle, ModelType type) {
|
RoundingSide roundingSide, double angle, ModelType type) {
|
||||||
Model entryArrow = ModelFactory.importModel(type);
|
Model entryArrow = ModelFactory.importModel(type);
|
||||||
|
angle = Math.toRadians(angle);
|
||||||
int multiplier = roundingSide == RoundingSide.STARBOARD ? 1 : -1;
|
int multiplier = roundingSide == RoundingSide.STARBOARD ? 1 : -1;
|
||||||
double relativeX = multiplier * 5 * Math.sin(angle + Math.PI / 2);
|
double relativeX = multiplier * 10 * Math.sin(angle + Math.PI / 8);
|
||||||
double relativeY = multiplier * 5 * Math.cos(angle + Math.PI / 2);
|
double relativeY = multiplier * 10 * Math.cos(angle + Math.PI / 8);
|
||||||
double xStart = relativeX + multiplier * 20 * Math.sin(angle + Math.PI / 2);
|
double xStart = relativeX + multiplier * 10 * Math.sin(angle - Math.PI / 2);
|
||||||
double yStart = relativeY + multiplier * 20 * Math.cos(angle + Math.PI / 2);
|
double yStart = relativeY + multiplier * 10 * Math.cos(angle - Math.PI / 2);
|
||||||
entryArrow.getAssets().getTransforms().addAll(
|
entryArrow.getAssets().getTransforms().addAll(
|
||||||
new Translate(xStart, yStart, 0),
|
new Translate(xStart, yStart, 0),
|
||||||
new Rotate(Math.toDegrees(angle), new Point3D(0,0,1))
|
new Rotate(Math.toDegrees(angle), new Point3D(0,0,1))
|
||||||
);
|
);
|
||||||
return entryArrow;
|
return entryArrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Model constructExitArrow3D (
|
public static Model constructExitArrow3D (
|
||||||
RoundingSide roundingSide, double angle, ModelType type) {
|
RoundingSide roundingSide, double angle, ModelType type) {
|
||||||
Model exitArrow = ModelFactory.importModel(type);
|
Model exitArrow = ModelFactory.importModel(type);
|
||||||
// angle = Math.toRadians(angle-65);
|
|
||||||
angle = Math.toRadians(angle);
|
angle = Math.toRadians(angle);
|
||||||
int multiplier = roundingSide == RoundingSide.STARBOARD ? 1 : -1;
|
int multiplier = roundingSide == RoundingSide.STARBOARD ? 1 : -1;
|
||||||
double xStart = multiplier * 6 * Math.sin(angle + Math.PI / 2);
|
double xStart = multiplier * 6 * Math.sin(angle + Math.PI / 8);
|
||||||
double yStart = multiplier * 6 * Math.cos(angle + Math.PI / 2);
|
double yStart = multiplier * 6 * Math.cos(angle + Math.PI / 8);
|
||||||
// exitArrow.getAssets().getTransforms().addAll(
|
exitArrow.getAssets().getTransforms().addAll(
|
||||||
// new Translate(xStart, yStart, 0),
|
new Translate(xStart, yStart, 0),
|
||||||
// new Rotate(Math.toDegrees(Math.toDegrees(angle)), new Point3D(0,0,1))
|
new Rotate(Math.toDegrees(angle), new Point3D(0,0,1))
|
||||||
// );
|
);
|
||||||
Circle c = new Circle(xStart, yStart, 1, Color.RED);
|
return exitArrow;
|
||||||
c.setStroke(Color.TRANSPARENT);
|
|
||||||
return new Model(new Group(c), null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user