For perspective cameras, there is a check in FlyByCamera.zoomCamera() to prevent the field-of-view angle from going negative or "too close" to zero, which is considered an invalid state:
|
} else { // perspective projection |
|
float newFov = cam.getFov() + value * 0.1F * zoomSpeed; |
|
// Use a small epsilon to prevent near-zero FoV issues |
|
if (newFov > 0.01f) { |
|
cam.setFov(newFov); |
|
} |
|
} |
However, there's nothing to prevent the angle from exceeding 180 degrees. This puts the camera in an invalid state where, for instance, getFrustumTop() < cam.getFrustumBottom().
For reasonable values of zoomSpeed (such as 20) it's easy to zoom out a perspective camera until the field-of-view exceeds 180 degrees.
To prevent this, the check in zoomCamera() should be changed to something like:
if (newFov > 0.01f && newFov < 179f) {
Testing suggests this is not a new issue. It was present in JME v3.2.4-stable.
For perspective cameras, there is a check in
FlyByCamera.zoomCamera()to prevent the field-of-view angle from going negative or "too close" to zero, which is considered an invalid state:jmonkeyengine/jme3-core/src/main/java/com/jme3/input/FlyByCamera.java
Lines 447 to 453 in c40043a
However, there's nothing to prevent the angle from exceeding 180 degrees. This puts the camera in an invalid state where, for instance,
getFrustumTop() < cam.getFrustumBottom().For reasonable values of
zoomSpeed(such as 20) it's easy to zoom out a perspective camera until the field-of-view exceeds 180 degrees.To prevent this, the check in
zoomCamera()should be changed to something like:Testing suggests this is not a new issue. It was present in JME v3.2.4-stable.