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
This commit is contained in:
parent
cf93c2c6fc
commit
fecf355de2
@ -107,6 +107,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
|||||||
protected final static String ChaseCamMoveLeft = "ChaseCamMoveLeft";
|
protected final static String ChaseCamMoveLeft = "ChaseCamMoveLeft";
|
||||||
protected final static String ChaseCamMoveRight = "ChaseCamMoveRight";
|
protected final static String ChaseCamMoveRight = "ChaseCamMoveRight";
|
||||||
protected final static String ChaseCamToggleRotate = "ChaseCamToggleRotate";
|
protected final static String ChaseCamToggleRotate = "ChaseCamToggleRotate";
|
||||||
|
protected boolean zoomin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs the chase camera
|
* 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) {
|
public void onAnalog(String name, float value, float tpf) {
|
||||||
if (name.equals(ChaseCamMoveLeft)) {
|
if (name.equals(ChaseCamMoveLeft)) {
|
||||||
@ -266,7 +267,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
|||||||
inputManager.addListener(this, ChaseCamZoomOut);
|
inputManager.addListener(this, ChaseCamZoomOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void computePosition() {
|
protected void computePosition() {
|
||||||
|
|
||||||
float hDistance = (distance) * FastMath.sin((FastMath.PI / 2) - vRotation);
|
float hDistance = (distance) * FastMath.sin((FastMath.PI / 2) - vRotation);
|
||||||
pos.set(hDistance * FastMath.cos(rotation), (distance) * FastMath.sin(vRotation), hDistance * FastMath.sin(rotation));
|
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
|
//rotate the camera around the target on the horizontal plane
|
||||||
private void rotateCamera(float value) {
|
protected void rotateCamera(float value) {
|
||||||
if (!canRotate || !enabled) {
|
if (!canRotate || !enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -285,7 +286,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//move the camera toward or away the target
|
//move the camera toward or away the target
|
||||||
private void zoomCamera(float value) {
|
protected void zoomCamera(float value) {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -306,7 +307,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//rotate the camera around the target on the vertical plane
|
//rotate the camera around the target on the vertical plane
|
||||||
private void vRotateCamera(float value) {
|
protected void vRotateCamera(float value) {
|
||||||
if (!canRotate || !enabled) {
|
if (!canRotate || !enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user