AI2 Component
(Version nb184)
|
Static Public Member Functions | |
static float | normalizeAzimuth (float azimuth) |
static float | normalizePitch (float pitch) |
static float | normalizeRoll (float roll) |
Functionality related to com.google.appinventor.components.runtime.OrientationSensor, placed in this static utility class for easier testing.
Definition at line 15 of file OrientationSensorUtil.java.
|
static |
Normalizes azimuth to be in the range [0, 360).
azimuth | an angle in degrees, likely to be in (-360, +360) |
Definition at line 47 of file OrientationSensorUtil.java.
|
static |
Normalizes pitch to be in the range [-180, +180).
pitch | an angle in degrees, likely to be in (-360, +360) |
Definition at line 57 of file OrientationSensorUtil.java.
|
static |
Normalizes roll to be in the range [-90, +90] degrees. The App Inventor definition of Roll in the documentation is:
0 degrees when the device is level, increasing to 90 degrees as the device is tilted up onto its left side, and decreasing to -90 degrees when the device is tilted up onto its right side.
After rotating the phone more than 90 degrees, Roll decreased. For compatibility, we are guaranteeing the same behavior.
roll | an angle likely to be in the range [-180, +180] |
Definition at line 79 of file OrientationSensorUtil.java.