Class MathUtils

java.lang.Object
com.shanebeestudios.nms.api.util.MathUtils

public class MathUtils extends Object
Utility class for math methods
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    clamp(float num, float min, float max)
    Clamp a float between a min and a max
    static int
    clamp(int num, int min, int max)
    Clamp an int between a min and a max

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MathUtils

      public MathUtils()
  • Method Details

    • clamp

      public static float clamp(float num, float min, float max)
      Clamp a float between a min and a max
      Parameters:
      num - Float to clamp
      min - Min value
      max - Max value
      Returns:
      Clamped float
    • clamp

      public static int clamp(int num, int min, int max)
      Clamp an int between a min and a max
      Parameters:
      num - Int to clamp
      min - Min value
      max - Max value
      Returns:
      Clamped int