summaryrefslogtreecommitdiffstats
path: root/opengl/java/android
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-07-30 14:06:35 -0700
committerRomain Guy <romainguy@google.com>2012-07-30 14:06:35 -0700
commit0a088f5d4681fd2da6f610de157bf905df787bf7 (patch)
tree8d5e765c49b7bcbfbaeab8c15bca38746d45984b /opengl/java/android
parentc25259519f1b74bb62a2b051b74537f073436b5c (diff)
downloadframeworks_base-0a088f5d4681fd2da6f610de157bf905df787bf7.zip
frameworks_base-0a088f5d4681fd2da6f610de157bf905df787bf7.tar.gz
frameworks_base-0a088f5d4681fd2da6f610de157bf905df787bf7.tar.bz2
Fix android.opengl.Matrix frustum's generation
External bug report: http://code.google.com/p/android/issues/detail?id=35646 Change-Id: I845783c05da46855f0c1d824c9a367f0e4673b85
Diffstat (limited to 'opengl/java/android')
-rw-r--r--opengl/java/android/opengl/Matrix.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/opengl/java/android/opengl/Matrix.java b/opengl/java/android/opengl/Matrix.java
index 7c72ae4..3f07337 100644
--- a/opengl/java/android/opengl/Matrix.java
+++ b/opengl/java/android/opengl/Matrix.java
@@ -312,7 +312,6 @@ public class Matrix {
* @param near
* @param far
*/
-
public static void frustumM(float[] m, int offset,
float left, float right, float bottom, float top,
float near, float far) {
@@ -336,10 +335,10 @@ public class Matrix {
final float r_depth = 1.0f / (near - far);
final float x = 2.0f * (near * r_width);
final float y = 2.0f * (near * r_height);
- final float A = 2.0f * ((right + left) * r_width);
+ final float A = (right + left) * r_width;
final float B = (top + bottom) * r_height;
- final float C = (far + near) * r_depth;
- final float D = 2.0f * (far * near * r_depth);
+ final float C = -(far + near) * r_depth;
+ final float D = -2.0f * (far * near * r_depth);
m[offset + 0] = x;
m[offset + 5] = y;
m[offset + 8] = A;