Ok let me help you out. First lets talk about clamp.
there are many clamp methods, for different types. let’s take the float example since it’s the most common one.
static public float clamp (float value, float min, float max) {
if (value < min) return min;
if (value > max) return max;
return value;
}
value is the initial value, min is the lowest you want it to be, max is the highest you want it to be.
so let’s say I am getting some float value that tends to be around 0f to 1.5f, but I don’t want any values to go over 1.0f, then I will call
float myValue = ... /// tends to be in 0f to 1.5f range
float myClampedValue = MathUtils.clamp(myValue, 0f, 1.0f); // guaranteed to be between 0f and 1.0f
Now lets talk about Interpolation. The interpolation methods work based on a provided alpha value. an alpha value of 0f means that the interpolation is at the very beginning of its track, a value of 1.0f means it is at the very end. There are many different interpolation methods in libgdx and you can learn more about them from this video: