Fixed a bug with the orientation calculation.
This commit is contained in:
@@ -67,7 +67,7 @@ public abstract class Utils{
|
|||||||
* @return True if the device can detect it's orientation and it's within range. False otherwise.
|
* @return True if the device can detect it's orientation and it's within range. False otherwise.
|
||||||
*/
|
*/
|
||||||
public static boolean isDeviceRollValid(){
|
public static boolean isDeviceRollValid(){
|
||||||
boolean rollValid = false;
|
boolean rollValid = true;
|
||||||
float azimuth, pitch;
|
float azimuth, pitch;
|
||||||
|
|
||||||
if(deviceHasOrientationSensors()){
|
if(deviceHasOrientationSensors()){
|
||||||
@@ -79,7 +79,8 @@ public abstract class Utils{
|
|||||||
|
|
||||||
if(rollValid && (azimuth < MIN_AZIMUTH || azimuth > MAX_AZIMUTH))
|
if(rollValid && (azimuth < MIN_AZIMUTH || azimuth > MAX_AZIMUTH))
|
||||||
rollValid = false;
|
rollValid = false;
|
||||||
}
|
}else
|
||||||
|
rollValid = false;
|
||||||
|
|
||||||
return rollValid;
|
return rollValid;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user