removed print statements and added documentation.

tags : #story[1273]
This commit is contained in:
Alistair McIntyre
2017-09-26 18:36:13 +13:00
parent f11c457d28
commit 9b00f76907
3 changed files with 56 additions and 0 deletions
@@ -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;