mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
removed print statements and added documentation.
tags : #story[1273]
This commit is contained in:
@@ -37,6 +37,11 @@ public class ChaseCamera extends PerspectiveCamera implements RaceCamera {
|
||||
this.verticalPan = 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a player boat object to observe and update the camera with.
|
||||
*
|
||||
* @param playerBoat The player boat to be observed.
|
||||
*/
|
||||
public void setPlayerBoat(BoatObject playerBoat) {
|
||||
this.playerBoat = playerBoat;
|
||||
|
||||
@@ -47,6 +52,9 @@ public class ChaseCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the camera to a new position after some change (Zooming or Panning)
|
||||
*/
|
||||
private void repositionCamera() {
|
||||
transforms.clear();
|
||||
transforms.addAll(
|
||||
@@ -58,6 +66,10 @@ public class ChaseCamera extends PerspectiveCamera implements RaceCamera {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the zoom amount (camera depth) by some adjustment value
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustZoomFactor(Double adjustment) {
|
||||
if (zoomFactor + adjustment < NEAR_ZOOM_LIMIT && zoomFactor + adjustment > FAR_ZOOM_LIMIT) {
|
||||
zoomFactor = zoomFactor + adjustment;
|
||||
@@ -65,6 +77,10 @@ public class ChaseCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the Vertical Panning of the Camera
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustVerticalPan(Double adjustment) {
|
||||
if (verticalPan + adjustment >= -VERTICAL_PAN_LIMIT
|
||||
&& verticalPan + adjustment <= VERTICAL_PAN_LIMIT) {
|
||||
@@ -73,6 +89,10 @@ public class ChaseCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the Horizontal Panning of the Camera.
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustHorizontalPan(Double adjustment) {
|
||||
this.horizontalPan += adjustment;
|
||||
repositionCamera();
|
||||
|
||||
@@ -36,6 +36,9 @@ public class IsometricCamera extends PerspectiveCamera implements RaceCamera {
|
||||
updateCamera();
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the camera to a new position after some change (Zooming or Panning)
|
||||
*/
|
||||
private void updateCamera() {
|
||||
transforms.clear();
|
||||
transforms.addAll(
|
||||
@@ -44,6 +47,11 @@ public class IsometricCamera extends PerspectiveCamera implements RaceCamera {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the zoom amount (camera depth) by some adjustment value
|
||||
*
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustZoomFactor(Double adjustment) {
|
||||
if (zoomFactor + adjustment < NEAR_ZOOM_LIMIT && zoomFactor + adjustment > FAR_ZOOM_LIMIT) {
|
||||
zoomFactor = zoomFactor + adjustment;
|
||||
@@ -51,6 +59,10 @@ public class IsometricCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the Vertical Panning of the Camera
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustVerticalPan(Double adjustment) {
|
||||
if (verticalPan + adjustment >= MIN_Y && verticalPan + adjustment <= MAX_Y) {
|
||||
verticalPan += adjustment;
|
||||
@@ -58,6 +70,10 @@ public class IsometricCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the Horizontal Panning of the Camera.
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustHorizontalPan(Double adjustment) {
|
||||
if (horizontalPan + adjustment >= MIN_X && horizontalPan + adjustment <= MIN_Y) {
|
||||
this.horizontalPan += adjustment;
|
||||
|
||||
@@ -32,6 +32,11 @@ public class TopDownCamera extends PerspectiveCamera implements RaceCamera {
|
||||
verticalPan = 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a player boat object to observe and update the camera with.
|
||||
*
|
||||
* @param playerBoat The player boat to be observed.
|
||||
*/
|
||||
public void setPlayerBoat(BoatObject playerBoat) {
|
||||
this.playerBoat = playerBoat;
|
||||
|
||||
@@ -41,6 +46,9 @@ public class TopDownCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the camera to a new position after some change (Zooming or Panning)
|
||||
*/
|
||||
private void updateCamera() {
|
||||
transforms.clear();
|
||||
transforms.addAll(
|
||||
@@ -49,6 +57,10 @@ public class TopDownCamera extends PerspectiveCamera implements RaceCamera {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the zoom amount (camera depth) by some adjustment value
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustZoomFactor(Double adjustment) {
|
||||
if (zoomFactor + adjustment < NEAR_ZOOM_LIMIT && zoomFactor + adjustment > FAR_ZOOM_LIMIT) {
|
||||
zoomFactor = zoomFactor + adjustment;
|
||||
@@ -56,6 +68,10 @@ public class TopDownCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the Vertical Panning of the Camera
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustVerticalPan(Double adjustment) {
|
||||
if (verticalPan + adjustment >= -PAN_LIMIT && verticalPan + adjustment <= PAN_LIMIT) {
|
||||
verticalPan += adjustment;
|
||||
@@ -63,6 +79,10 @@ public class TopDownCamera extends PerspectiveCamera implements RaceCamera {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the Horizontal Panning of the Camera.
|
||||
* @param adjustment the adjustment to be made to the camera
|
||||
*/
|
||||
private void adjustHorizontalPan(Double adjustment) {
|
||||
if (horizontalPan + adjustment >= -PAN_LIMIT && horizontalPan + adjustment <= PAN_LIMIT) {
|
||||
horizontalPan += adjustment;
|
||||
|
||||
Reference in New Issue
Block a user