|
@@ -76,6 +76,7 @@ public class FlyByCamera implements AnalogListener, ActionListener {
|
|
protected Vector3f initialUpVec;
|
|
protected Vector3f initialUpVec;
|
|
protected float rotationSpeed = 1f;
|
|
protected float rotationSpeed = 1f;
|
|
protected float moveSpeed = 3f;
|
|
protected float moveSpeed = 3f;
|
|
|
|
+ protected float zoomSpeed = 1f;
|
|
protected MotionAllowedListener motionAllowed = null;
|
|
protected MotionAllowedListener motionAllowed = null;
|
|
protected boolean enabled = true;
|
|
protected boolean enabled = true;
|
|
protected boolean dragToRotate = false;
|
|
protected boolean dragToRotate = false;
|
|
@@ -134,6 +135,23 @@ public class FlyByCamera implements AnalogListener, ActionListener {
|
|
public float getRotationSpeed(){
|
|
public float getRotationSpeed(){
|
|
return rotationSpeed;
|
|
return rotationSpeed;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Sets the zoom speed.
|
|
|
|
+ * @param zoomSpeed
|
|
|
|
+ */
|
|
|
|
+ public void setZoomSpeed(float zoomSpeed) {
|
|
|
|
+ this.zoomSpeed = zoomSpeed;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the zoom speed. The speed is a multiplier to increase/decrease
|
|
|
|
+ * the zoom rate.
|
|
|
|
+ * @return zoomSpeed
|
|
|
|
+ */
|
|
|
|
+ public float getZoomSpeed() {
|
|
|
|
+ return zoomSpeed;
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* @param enable If false, the camera will ignore input.
|
|
* @param enable If false, the camera will ignore input.
|
|
@@ -294,7 +312,7 @@ public class FlyByCamera implements AnalogListener, ActionListener {
|
|
|
|
|
|
float fovY = FastMath.atan(h / near)
|
|
float fovY = FastMath.atan(h / near)
|
|
/ (FastMath.DEG_TO_RAD * .5f);
|
|
/ (FastMath.DEG_TO_RAD * .5f);
|
|
- fovY += value * 0.1f;
|
|
|
|
|
|
+ fovY += value * 0.1f * zoomSpeed;
|
|
|
|
|
|
h = FastMath.tan( fovY * FastMath.DEG_TO_RAD * .5f) * near;
|
|
h = FastMath.tan( fovY * FastMath.DEG_TO_RAD * .5f) * near;
|
|
w = h * aspect;
|
|
w = h * aspect;
|