I’ve written and tested the following patch. May I commit it to /branches/gradle-restructure/jme3-core/src/main/java/com/jme3/input/FlyByCamera.java and /trunk/engine/src/core/com/jme3/input/FlyByCamera.java
?
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -341,7 +341,11 @@
float fovY = FastMath.atan(h / near)
/ (FastMath.DEG_TO_RAD * .5f);
- fovY += value * 0.1f * zoomSpeed;
+ float newFovY = fovY + value * 0.1f * zoomSpeed;
+ if (newFovY > 0f) {
+ // Don't let the FOV go zero or negative.
+ fovY = newFovY;
+ }
h = FastMath.tan( fovY * FastMath.DEG_TO_RAD * .5f) * near;
w = h * aspect;
You can… I’d suggest making it optional but I already want to cut FlyByCam out of the engine with a rusty spoon. So I’m not sure I care which way we beat this particular dead horse.
Though adding features to this class is a slippery slope. To make it useful for any game at all it needs about a half dozen more features… so any real game will end up writing their own. I’d rename it to DemoCam but it would break everything.
Edit: nevermind about the optional part. I thought this was the pitch lock thing. Yes, the fix is good. I should sleep soon, I think.