Przeglądaj źródła

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
rem..om 13 lat temu
rodzic
commit
fecf355de2
1 zmienionych plików z 6 dodań i 5 usunięć
  1. 6 5
      engine/src/core/com/jme3/input/ChaseCamera.java

+ 6 - 5
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;
         }