예제 #1
0
 public static float normalizeAngle(float angle, float min, float max) {
   float result = angle;
   if (min < 0.0f) {
     while (result <= -180.0f) result += 360.0f;
     while (result > 180.0f) result -= 360.0f;
   } else {
     while (result < 0.0f) result += 360.0f;
     while (result >= 360.0f) result -= 360.0f;
   }
   return PLMath.valueInRange(result, min, max);
 }
예제 #2
0
 public static float normalizeFov(float fov, float min, float max) {
   return PLMath.valueInRange(fov, min, max);
 }
예제 #3
0
 public static float normalizeFov(float fov, PLRange range) {
   return PLMath.valueInRange(fov, range);
 }