Bugfix: issue #622 (FlybyCamera zooms to negative FOV) in trunk
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@11082 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
b30ca28704
commit
693fea52bc
@ -341,7 +341,11 @@ 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 * 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;
|
h = FastMath.tan( fovY * FastMath.DEG_TO_RAD * .5f) * near;
|
||||||
w = h * aspect;
|
w = h * aspect;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user