Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
8018e1ba
Commit
8018e1ba
authored
Oct 23, 2024
by
Riegel
Browse files
Add upside-down icon for NorthArrow
parent
aad64166
Pipeline
#10279
passed with stage
in 1 minute and 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/MainWindow.java
View file @
8018e1ba
...
...
@@ -237,6 +237,9 @@ public class MainWindow extends Application {
@FXML
private
Label
availableLabel
;
private
Image
north
;
private
Image
northFlip
;
private
Group
meshGroup
;
private
Group
world
;
...
...
@@ -858,7 +861,8 @@ public class MainWindow extends Application {
meshGroup
=
new
Group
();
world
.
getChildren
().
add
(
meshGroup
);
Image
north
=
new
Image
(
getClass
().
getResourceAsStream
(
"icons/north.png"
));
north
=
new
Image
(
getClass
().
getResourceAsStream
(
"icons/north.png"
));
northFlip
=
new
Image
(
getClass
().
getResourceAsStream
(
"icons/north_flip.png"
));
northArrow
=
new
ImageView
(
north
);
northArrow
.
setFitHeight
(
50
);
northArrow
.
setFitWidth
(
50
);
...
...
@@ -940,8 +944,19 @@ public class MainWindow extends Application {
double
absRotZ
=
cameraZRotation
.
getAngle
()
-
360
*
Math
.
floor
(
cameraZRotation
.
getAngle
()
/
360
);
double
absRotX
=
cameraXRotation
.
getAngle
()
-
360
*
Math
.
floor
(
cameraXRotation
.
getAngle
()
/
360
);
double
northRot
=
((
80
<=
absRotX
&&
absRotX
<=
260
)
?
360
-
absRotZ:
(
absRotZ
+
180
)%
360
);
double
northRot
;
if
(
80
<=
absRotX
&&
absRotX
<=
260
){
northRot
=
360
-
absRotZ
;
if
(
northArrow
.
getImage
()
!=
north
){
northArrow
.
setImage
(
north
);
}
}
else
{
//Camera is below horizon line -> flip north arrow horizontally
northRot
=
(
absRotZ
+
180
)%
360
;
if
(
northArrow
.
getImage
()
!=
northFlip
){
northArrow
.
setImage
(
northFlip
);
}
}
northArrow
.
setRotate
(
northRot
);
}
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/resources/de/hft/stuttgart/citydoctor2/gui/icons/north_flip.png
0 → 100644
View file @
8018e1ba
2.05 KB
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment