Java Float Number Clamp clampYaw(float yaw)

Here you can find the source of clampYaw(float yaw)

Description

clamp Yaw

License

Open Source License

Declaration

public static float clampYaw(float yaw) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static float clampYaw(float yaw) {
        while (yaw < -180.0F) {
            yaw += 360.0F;/*  ww  w .  jav a2s.  c om*/
        }

        while (yaw >= 180.0F) {
            yaw -= 360.0F;
        }
        return yaw;
    }
}

Related

  1. clampToMinusOneToOne(float value)
  2. clampToPositiveNonZero(float value)
  3. clampTrigo(float value, float min, float max)
  4. clampWithMod(float parFloat, float parMax)
  5. clampYaw(float yaw)
  6. clampZero_float(float value, float max)