Skip to content

Commit

Permalink
Updated perspective tests and removed the transpose in CameraPerspect…
Browse files Browse the repository at this point in the history
…ive ctor
  • Loading branch information
thehiflyer committed May 21, 2012
1 parent b992ad7 commit 10d0bf6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public CameraPerspective(float fovInDegrees, float aspect, float zNear, float zF
this.aspect = aspect; this.aspect = aspect;
this.zNear = zNear; this.zNear = zNear;
this.zFar = zFar; this.zFar = zFar;
matrix = new Matrix4(buildPerspectiveMatrix(fovInDegrees, aspect, zNear, zFar)).transpose(); matrix = new Matrix4(buildPerspectiveMatrix(fovInDegrees, aspect, zNear, zFar));
} }




Expand Down Expand Up @@ -53,11 +53,11 @@ private FloatBuffer buildPerspectiveMatrix(float fovInDegrees, float aspect, flo
matrix.put(8, 0); matrix.put(8, 0);
matrix.put(9, 0); matrix.put(9, 0);
matrix.put(10, -q); matrix.put(10, -q);
matrix.put(11, 1); matrix.put(11, qn);


matrix.put(12, 0); matrix.put(12, 0);
matrix.put(13, 0); matrix.put(13, 0);
matrix.put(14, qn); matrix.put(14, 1);
matrix.put(15, 0); matrix.put(15, 0);
matrix.rewind(); matrix.rewind();
return matrix; return matrix;
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public void matrix() throws Exception {
assertEquals(0f, matrix.getValue(2, 0), EPSILON); assertEquals(0f, matrix.getValue(2, 0), EPSILON);
assertEquals(0f, matrix.getValue(2, 1), EPSILON); assertEquals(0f, matrix.getValue(2, 1), EPSILON);
assertEquals(1.0020020f, matrix.getValue(2, 2), 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, 0), EPSILON);
assertEquals(0f, matrix.getValue(3, 1), 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); assertEquals(0f, matrix.getValue(3, 3), EPSILON);
} }
} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public void projectionMatrix() throws Exception {
assertEquals(0f, matrix.get(8), EPSILON); assertEquals(0f, matrix.get(8), EPSILON);
assertEquals(0f, matrix.get(9), EPSILON); assertEquals(0f, matrix.get(9), EPSILON);
assertEquals(1.0020020f, matrix.get(10), 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(12), EPSILON);
assertEquals(0f, matrix.get(13), 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); assertEquals(0f, matrix.get(15), EPSILON);
} }


Expand Down

0 comments on commit 10d0bf6

Please sign in to comment.