List of utility methods to do interpolate
double | interpolatefinal(double a, final double b, final double d) interpolatefinal return approachExp(a, b, d);
|
float | interpolateFloat(float f0, float f1, double mixer) interpolate Float return (float) (f0 * (1d - mixer) + f1 * mixer); |
float | interpolateFloat(float t, float a, float b) Does a linear interpolation using doubles return a + t * (b - a);
|
float | interpolateLinear(final float a, final float b, final float t) interpolate Linear return a + t * (b - a);
|
float | interpolateLinear(float lastState, float currentState, float ip) interpolate Linear return lastState + (currentState - lastState) * ip;
|
String | interpolateProp(final String source, final String propName, final String defValue) interpolate Prop return source.replace("${" + propName + "}", System.getProperty(propName, defValue)); |
float | interpolateRotation(float par1, float par2, float par3) interpolate Rotation float f3; for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F) { ; while (f3 >= 180.0F) { f3 -= 360.0F; return par1 + par3 * f3; ... |
float | interpolateRotation(float prevRotation, float nextRotation, float partialTick) interpolate Rotation float rot = nextRotation - prevRotation; while (rot >= 180.0F) { rot -= 360.0F; while (rot >= 180.0F) { rot -= 360.0F; return prevRotation + partialTick * rot; ... |
double | interpolateRound(double a, double b, double t) interpolate Round return Math.round(interpolateNumber(a, b, t));
|
float | interpolateSmoothly(final float position, final float startPosition, final float endPosition, final float startValue, final float endValue) Calculates a smoothly (cosine) interpolated value, given a start value, an end value, and the position to get the value at. final float relativePosition = (position - startPosition) / (endPosition - startPosition); float result; if (relativePosition <= 0) { result = startValue; } else if (relativePosition >= 1) { result = endValue; } else { final double relativeSmoothPosition = (1.0 - Math.cos(relativePosition * Math.PI)) / 2.0; ... |