Class WrapperInterpolation

java.lang.Object
com.badlogic.gdx.math.Interpolation
com.github.yellowstonegames.smooth.WrapperInterpolation
All Implemented Interfaces:
FloatSmoother

public class WrapperInterpolation extends com.badlogic.gdx.math.Interpolation implements FloatSmoother
A simple wrapper around a digital Interpolations.Interpolator so it can act as a libGDX Interpolation. Just pass an Interpolator to the constructor, and you have an Interpolation that uses it. This also acts as a FloatSmoother using the wrapped Interpolator. If you need to go in the reverse direction and create an Interpolations.Interpolator from an Interpolation (let's call it myInterpolation, you can use new Interpolator("myInterpolation", myInterpolation::apply).
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.badlogic.gdx.math.Interpolation

    com.badlogic.gdx.math.Interpolation.Bounce, com.badlogic.gdx.math.Interpolation.BounceIn, com.badlogic.gdx.math.Interpolation.BounceOut, com.badlogic.gdx.math.Interpolation.Elastic, com.badlogic.gdx.math.Interpolation.ElasticIn, com.badlogic.gdx.math.Interpolation.ElasticOut, com.badlogic.gdx.math.Interpolation.Exp, com.badlogic.gdx.math.Interpolation.ExpIn, com.badlogic.gdx.math.Interpolation.ExpOut, com.badlogic.gdx.math.Interpolation.Pow, com.badlogic.gdx.math.Interpolation.PowIn, com.badlogic.gdx.math.Interpolation.PowOut, com.badlogic.gdx.math.Interpolation.Swing, com.badlogic.gdx.math.Interpolation.SwingIn, com.badlogic.gdx.math.Interpolation.SwingOut
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final com.github.tommyettinger.digital.Interpolations.Interpolator
     

    Fields inherited from class com.badlogic.gdx.math.Interpolation

    bounce, bounceIn, bounceOut, circle, circleIn, circleOut, elastic, elasticIn, elasticOut, exp10, exp10In, exp10Out, exp5, exp5In, exp5Out, fade, fastSlow, linear, pow2, pow2In, pow2InInverse, pow2Out, pow2OutInverse, pow3, pow3In, pow3InInverse, pow3Out, pow3OutInverse, pow4, pow4In, pow4Out, pow5, pow5In, pow5Out, sine, sineIn, sineOut, slowFast, smooth, smooth2, smoother, swing, swingIn, swingOut

    Fields inherited from interface FloatSmoother

    ANGLE, LINEAR
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    WrapperInterpolation(com.github.tommyettinger.digital.Interpolations.Interpolator toWrap)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    apply(float v)
     
    float
    apply(float start, float end, float a)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • wrapped

      public final com.github.tommyettinger.digital.Interpolations.Interpolator wrapped
  • Constructor Details

    • WrapperInterpolation

      public WrapperInterpolation()
    • WrapperInterpolation

      public WrapperInterpolation(com.github.tommyettinger.digital.Interpolations.Interpolator toWrap)
  • Method Details

    • apply

      public float apply(float v)
      Specified by:
      apply in class com.badlogic.gdx.math.Interpolation
    • apply

      public float apply(float start, float end, float a)
      Specified by:
      apply in interface FloatSmoother
      Overrides:
      apply in class com.badlogic.gdx.math.Interpolation