Package codechicken.lib.math
Class InterpHelper
java.lang.Object
codechicken.lib.math.InterpHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatinterpolate(float q0, float q1, float q2, float q3) Interpolates using the already computed coefficients.voidlocate(float x, float y) Computes the coefficients for the interpolation.voidreset(float dx0, float dy0, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) Resets the interp helper with the given quad.voidsetup()Call when you are ready to use the InterpHelper.
-
Constructor Details
-
InterpHelper
public InterpHelper()
-
-
Method Details
-
reset
public void reset(float dx0, float dy0, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) Resets the interp helper with the given quad. Does not care what order the vertices are in. -
setup
public void setup()Call when you are ready to use the InterpHelper. -
locate
public void locate(float x, float y) Computes the coefficients for the interpolation.- Parameters:
x- X interp location.y- Y interp location.
-
interpolate
public float interpolate(float q0, float q1, float q2, float q3) Interpolates using the already computed coefficients.- Parameters:
q0- Value at dx0 dy0q1- Value at dx1 dy1q2- Value at dx2 dy2q3- Value at dx3 dy3- Returns:
- The result.
-