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
3.0
PSp..om 12 years ago
parent 380b40b7e9
commit 4458603c7e
  1. 5
      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();
}

Loading…
Cancel
Save