Permalink
Browse files

Updated perspective tests and removed the transpose in CameraPerspect…

…ive ctor
  • Loading branch information...
1 parent b992ad7 commit 10d0bf6939d53afbc65bd9ca30e735a576051fd1 @thehiflyer thehiflyer committed May 21, 2012
@@ -19,7 +19,7 @@ public CameraPerspective(float fovInDegrees, float aspect, float zNear, float zF
this.aspect = aspect;
this.zNear = zNear;
this.zFar = zFar;
- matrix = new Matrix4(buildPerspectiveMatrix(fovInDegrees, aspect, zNear, zFar)).transpose();
+ matrix = new Matrix4(buildPerspectiveMatrix(fovInDegrees, aspect, zNear, zFar));
}
@@ -53,11 +53,11 @@ private FloatBuffer buildPerspectiveMatrix(float fovInDegrees, float aspect, flo
matrix.put(8, 0);
matrix.put(9, 0);
matrix.put(10, -q);
- matrix.put(11, 1);
+ matrix.put(11, qn);
matrix.put(12, 0);
matrix.put(13, 0);
- matrix.put(14, qn);
+ matrix.put(14, 1);
matrix.put(15, 0);
matrix.rewind();
return matrix;
@@ -27,11 +27,11 @@ public void matrix() throws Exception {
assertEquals(0f, matrix.getValue(2, 0), EPSILON);
assertEquals(0f, matrix.getValue(2, 1), EPSILON);
assertEquals(1.0020020f, matrix.getValue(2, 2), EPSILON);
- assertEquals(1f, matrix.getValue(2, 3), EPSILON);
+ assertEquals(-2.0020020f, matrix.getValue(2, 3), EPSILON);
assertEquals(0f, matrix.getValue(3, 0), EPSILON);
assertEquals(0f, matrix.getValue(3, 1), EPSILON);
- assertEquals(-2.0020020f, matrix.getValue(3, 2), EPSILON);
+ assertEquals(1f, matrix.getValue(3, 2), EPSILON);
assertEquals(0f, matrix.getValue(3, 3), EPSILON);
}
}
@@ -58,11 +58,11 @@ public void projectionMatrix() throws Exception {
assertEquals(0f, matrix.get(8), EPSILON);
assertEquals(0f, matrix.get(9), EPSILON);
assertEquals(1.0020020f, matrix.get(10), EPSILON);
- assertEquals(1f, matrix.get(11), EPSILON);
+ assertEquals(-2.0020020f, matrix.get(11), EPSILON);
assertEquals(0f, matrix.get(12), EPSILON);
assertEquals(0f, matrix.get(13), EPSILON);
- assertEquals(-2.0020020f, matrix.get(14), EPSILON);
+ assertEquals(1f, matrix.get(14), EPSILON);
assertEquals(0f, matrix.get(15), EPSILON);
}

0 comments on commit 10d0bf6

Please sign in to comment.