From 4458603c7e60cf7540c541648a2bda329ffb9d16 Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Tue, 6 Nov 2012 05:52:54 +0000 Subject: [PATCH] Attempt to make the isParallelProjection() flag better match the actual state of the Camera. When a camera is created it is initially not a perspective camera and now will reflect that. Setting the perspective frustum will also now clear this flag. The regular setFrustum can be used for ortho cameras and so does not change the mode. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9956 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/renderer/Camera.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/src/core/com/jme3/renderer/Camera.java b/engine/src/core/com/jme3/renderer/Camera.java index e20ac4abf..7e54a993c 100644 --- a/engine/src/core/com/jme3/renderer/Camera.java +++ b/engine/src/core/com/jme3/renderer/Camera.java @@ -194,7 +194,7 @@ public class Camera implements Savable, Cloneable { /** * store the value for field parallelProjection */ - private boolean parallelProjection; + private boolean parallelProjection = true; protected Matrix4f projectionMatrixOverride; protected Matrix4f viewMatrix = new Matrix4f(); protected Matrix4f projectionMatrix = new Matrix4f(); @@ -778,6 +778,9 @@ public class Camera implements Savable, Cloneable { frustumNear = near; frustumFar = far; + // Camera is no longer parallel projection even if it was before + parallelProjection = false; + onFrustumChange(); }