Map can be zoomed out in birds eye view only to a specified distance.

#story[1312]
main
Jessica Syder 8 years ago
parent ab49d62c0d
commit 915d61b9f3

@ -83,6 +83,7 @@ public class View3D extends Pane {
*/
private final double ZOOM_IN_LIMIT = 30;
private final double ZOOM_OUT_LIMIT = 700;
private final double MAX_ZOOM_LIMIT = 1500;
private final double MAX_PITCH = 60; // birds eye view
private final double MIN_PITCH = 5; // third person view
private final double ZOOM_PER_KEYPRESS = 5; // distance changed per zoom
@ -267,7 +268,11 @@ public class View3D extends Pane {
public void updateDistance(double delta) {
double newDistance = -this.distance.getZ() + delta;
if (target.get() == null){
setDistance(newDistance);
if (newDistance > MAX_ZOOM_LIMIT){
setDistance(MAX_ZOOM_LIMIT);
} else {
setDistance(newDistance);
}
} else if(newDistance <= ZOOM_IN_LIMIT) {
setDistance(ZOOM_IN_LIMIT);
} else if (newDistance > ZOOM_OUT_LIMIT){

Loading…
Cancel
Save