Merge "fix [3452750] Issue 14634: SensorManager.getRotationMatrixFromVector gets NaN-Values [external] [DO NOT MERGE]" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
b710a50ab6
@ -1970,7 +1970,8 @@ public class SensorManager
|
||||
if (rotationVector.length == 4) {
|
||||
q0 = rotationVector[3];
|
||||
} else {
|
||||
q0 = (float)Math.sqrt(1 - q1*q1 - q2*q2 - q3*q3);
|
||||
q0 = 1 - q1*q1 - q2*q2 - q3*q3;
|
||||
q0 = (q0 > 0) ? (float)Math.sqrt(q0) : 0;
|
||||
}
|
||||
|
||||
float sq_q1 = 2 * q1 * q1;
|
||||
|
Reference in New Issue
Block a user