Merge remote-tracking branch 'origin/ac35_map_boundary' into ac35_map_boundary
This commit is contained in:
@@ -28,7 +28,7 @@ public class Constants {
|
|||||||
* Frame periods are multiplied by this to get the amount of time a single frame represents.
|
* Frame periods are multiplied by this to get the amount of time a single frame represents.
|
||||||
* E.g., frame period = 20ms, scale = 5, frame represents 20 * 5 = 100ms, and so boats are simulated for 100ms, even though only 20ms actually occurred.
|
* E.g., frame period = 20ms, scale = 5, frame represents 20 * 5 = 100ms, and so boats are simulated for 100ms, even though only 20ms actually occurred.
|
||||||
*/
|
*/
|
||||||
public static final int RaceTimeScale = 2;
|
public static final int RaceTimeScale = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The race pre-start time, in milliseconds. 30 seconds.
|
* The race pre-start time, in milliseconds. 30 seconds.
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ public class MarkRoundingSequence {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* For each leg, mark rounding information.
|
* For each leg, mark rounding information.
|
||||||
|
* Maps between leg number and rounding data.
|
||||||
*/
|
*/
|
||||||
private Map<Leg, MarkRoundingData> roundingPoints;
|
private Map<Integer, MarkRoundingData> roundingPoints;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ public class MarkRoundingSequence {
|
|||||||
* @return Rounding points for leg.
|
* @return Rounding points for leg.
|
||||||
*/
|
*/
|
||||||
public MarkRoundingData getRoundingData(Leg leg) {
|
public MarkRoundingData getRoundingData(Leg leg) {
|
||||||
return roundingPoints.get(leg);
|
return roundingPoints.get(leg.getLegNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -139,7 +140,7 @@ public class MarkRoundingSequence {
|
|||||||
roundingData.setRoundCheck2Halfway(roundCheck2Halfway);
|
roundingData.setRoundCheck2Halfway(roundCheck2Halfway);
|
||||||
|
|
||||||
|
|
||||||
this.roundingPoints.put(currentLeg, roundingData);
|
this.roundingPoints.put(currentLeg.getLegNumber(), roundingData);
|
||||||
|
|
||||||
|
|
||||||
//Rounding points:
|
//Rounding points:
|
||||||
|
|||||||
@@ -576,7 +576,12 @@ public class RaceViewController extends Controller {
|
|||||||
|
|
||||||
// Bind zooming to scrolling
|
// Bind zooming to scrolling
|
||||||
view3D.setOnScroll(e -> {
|
view3D.setOnScroll(e -> {
|
||||||
view3D.updateDistance(e.getDeltaY());
|
//view3D.updateDistance(e.getDeltaY());
|
||||||
|
if (e.getDeltaY() > 0) {
|
||||||
|
view3D.zoomIn();
|
||||||
|
} else {
|
||||||
|
view3D.zoomOut();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bind zooming to keypress (Z/X default)
|
// Bind zooming to keypress (Z/X default)
|
||||||
|
|||||||
@@ -268,8 +268,10 @@ public class View3D extends Pane {
|
|||||||
public void updateDistance(double delta) {
|
public void updateDistance(double delta) {
|
||||||
double newDistance = -this.distance.getZ() + delta;
|
double newDistance = -this.distance.getZ() + delta;
|
||||||
if (target.get() == null){
|
if (target.get() == null){
|
||||||
if (newDistance > MAX_ZOOM_LIMIT){
|
if (newDistance > MAX_ZOOM_LIMIT) {
|
||||||
setDistance(MAX_ZOOM_LIMIT);
|
setDistance(MAX_ZOOM_LIMIT);
|
||||||
|
} else if (newDistance <= ZOOM_IN_LIMIT) {
|
||||||
|
setDistance(ZOOM_IN_LIMIT);
|
||||||
} else {
|
} else {
|
||||||
setDistance(newDistance);
|
setDistance(newDistance);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user