We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 75edf44 + e55eaac commit 1b8897aCopy full SHA for 1b8897a
android/src/main/java/com/joshblour/reactnativeheading/ReactNativeHeadingModule.java
@@ -83,8 +83,10 @@ public void onSensorChanged(SensorEvent event) {
83
// calculate th rotation matrix
84
SensorManager.getRotationMatrixFromVector(rMat, event.values);
85
// get the azimuth value (orientation[0]) in degree
86
+
87
newAzimuth = (int) ((((( Math.toDegrees( SensorManager.getOrientation( rMat, orientation )[0] ) + 360 ) % 360) -
88
( Math.toDegrees( SensorManager.getOrientation( rMat, orientation )[2] ))) +360) % 360);
89
90
//dont react to changes smaller than the filter value
91
if (Math.abs(mAzimuth - newAzimuth) < mFilter) {
92
return;
0 commit comments