Class InterpHelper

java.lang.Object
codechicken.lib.math.InterpHelper

public class InterpHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    interpolate(float q0, float q1, float q2, float q3)
    Interpolates using the already computed coefficients.
    void
    locate(float x, float y)
    Computes the coefficients for the interpolation.
    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.
    void
    Call when you are ready to use the InterpHelper.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 dy0
      q1 - Value at dx1 dy1
      q2 - Value at dx2 dy2
      q3 - Value at dx3 dy3
      Returns:
      The result.