Skip to content

Commit ddd6628

Browse files
authored
FlyByCamera: prevent camera field-of-view from zooming past 179 degrees (#2940)
1 parent c40043a commit ddd6628

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

jme3-core/src/main/java/com/jme3/input/FlyByCamera.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2025 jMonkeyEngine
2+
* Copyright (c) 2009-2026 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -447,7 +447,7 @@ protected void zoomCamera(float value) {
447447
} else { // perspective projection
448448
float newFov = cam.getFov() + value * 0.1F * zoomSpeed;
449449
// Use a small epsilon to prevent near-zero FoV issues
450-
if (newFov > 0.01f) {
450+
if (newFov > 0.01f && newFov < 179f) {
451451
cam.setFov(newFov);
452452
}
453453
}

0 commit comments

Comments
 (0)