ChaseCam : changed all private attributes and methods to protected so people can extend the chaseCam behavior as they see fit.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9260 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 13 years ago
parent cf93c2c6fc
commit fecf355de2
  1. 11
      engine/src/core/com/jme3/input/ChaseCamera.java

@ -107,6 +107,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
protected final static String ChaseCamMoveLeft = "ChaseCamMoveLeft";
protected final static String ChaseCamMoveRight = "ChaseCamMoveRight";
protected final static String ChaseCamToggleRotate = "ChaseCamToggleRotate";
protected boolean zoomin;
/**
* Constructs the chase camera
@ -166,7 +167,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
}
}
private boolean zoomin;
public void onAnalog(String name, float value, float tpf) {
if (name.equals(ChaseCamMoveLeft)) {
@ -266,7 +267,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
inputManager.addListener(this, ChaseCamZoomOut);
}
private void computePosition() {
protected void computePosition() {
float hDistance = (distance) * FastMath.sin((FastMath.PI / 2) - vRotation);
pos.set(hDistance * FastMath.cos(rotation), (distance) * FastMath.sin(vRotation), hDistance * FastMath.sin(rotation));
@ -274,7 +275,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
}
//rotate the camera around the target on the horizontal plane
private void rotateCamera(float value) {
protected void rotateCamera(float value) {
if (!canRotate || !enabled) {
return;
}
@ -285,7 +286,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
}
//move the camera toward or away the target
private void zoomCamera(float value) {
protected void zoomCamera(float value) {
if (!enabled) {
return;
}
@ -306,7 +307,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
}
//rotate the camera around the target on the vertical plane
private void vRotateCamera(float value) {
protected void vRotateCamera(float value) {
if (!canRotate || !enabled) {
return;
}

Loading…
Cancel
Save