Fix camera position being able to become NaN with classic controls

To reproduce, hold A for about a second, then release A and press D in the same frame.
This commit is contained in:
Jonas Herzig
2018-08-25 11:02:42 +02:00
parent b6a7d3bcda
commit 85a167a0d5

View File

@@ -126,7 +126,7 @@ public class ClassicCameraController implements CameraController {
lastCall = Sys.getTime();
if(direction == null || motion < THRESHOLD) {
if(direction == null || direction.lengthSquared() == 0 || motion < THRESHOLD) {
return;
}