Browse Source

Added missing const to camera matrix.

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
7b780b9f9b
  1. 8
      src/Camera.cpp

8
src/Camera.cpp

@ -45,10 +45,10 @@ void Camera::setPerspective(GLfloat fov, GLfloat near, GLfloat far) {
rawProjectionMatrix = Matrix4::translation(Vector3::zAxis(2*far*near/(far+near)));
/* Then apply magic perspective matrix (with reversed Z) */
static Matrix4 a(1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, -1.0f, -1.0f,
0.0f, 0.0f, 0.0f, 0.0f);
static const Matrix4 a(1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, -1.0f, -1.0f,
0.0f, 0.0f, 0.0f, 0.0f);
rawProjectionMatrix = a*rawProjectionMatrix;
/* Then scale the volume down so it fits in (-1, 1) in all directions */

Loading…
Cancel
Save