Package org.storynode.pigeon.math
Class Math
java.lang.Object
org.storynode.pigeon.math.Math
Math utilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleclamp(double val, double min, double max) Clamps a value between aminandmaxvalue (inclusive)static floatclamp(float val, float min, float max) Clamps a value between aminandmaxvalue (inclusive)static intclamp(int val, int min, int max) Clamps a value between aminandmaxvalue (inclusive)
-
Constructor Details
-
Math
public Math()
-
-
Method Details
-
clamp
public static float clamp(float val, float min, float max) Clamps a value between aminandmaxvalue (inclusive)- Parameters:
val- The value to clampmin- The minimum allowed valuemax- The maximum allowed value- Returns:
- The clamped value
-
clamp
public static int clamp(int val, int min, int max) Clamps a value between aminandmaxvalue (inclusive)- Parameters:
val- The value to clampmin- The minimum allowed valuemax- The maximum allowed value- Returns:
- The clamped value
-
clamp
public static double clamp(double val, double min, double max) Clamps a value between aminandmaxvalue (inclusive)- Parameters:
val- The value to clampmin- The minimum allowed valuemax- The maximum allowed value- Returns:
- The clamped value
-