Normalizes the given pitch angle to a value between +/-90 degrees. @param pitch the pitch in degrees @return the normalized pitch in degrees @see Location#getPitch()
(float pitch)
| 699 | * @see Location#getPitch() |
| 700 | */ |
| 701 | public static float normalizePitch(float pitch) { |
| 702 | if (pitch > 90.0f) { |
| 703 | pitch = 90.0f; |
| 704 | } else if (pitch < -90.0f) { |
| 705 | pitch = -90.0f; |
| 706 | } |
| 707 | return pitch; |
| 708 | } |
| 709 | } |