1 package aurelienribon.tweenengine.equations; 2 3 import aurelienribon.tweenengine.TweenEquation; 4 5 /** 6 * Easing equation based on Robert Penner's work: 7 * http://robertpenner.com/easing/ 8 * @author Aurelien Ribon | http://www.aurelienribon.com/ 9 */ 10 public abstract class Quart extends TweenEquation { 11 public static final Quart IN = new Quart() { 12 @Override 13 public final float compute(float t) { 14 return t*t*t*t; 15 } 16 17 @Override 18 public String toString() { 19 return "Quart.IN"; 20 } 21 }; 22 23 public static final Quart OUT = new Quart() { 24 @Override 25 public final float compute(float t) { 26 return -((t-=1)*t*t*t - 1); 27 } 28 29 @Override 30 public String toString() { 31 return "Quart.OUT"; 32 } 33 }; 34 35 public static final Quart INOUT = new Quart() { 36 @Override 37 public final float compute(float t) { 38 if ((t*=2) < 1) return 0.5f*t*t*t*t; 39 return -0.5f * ((t-=2)*t*t*t - 2); 40 } 41 42 @Override 43 public String toString() { 44 return "Quart.INOUT"; 45 } 46 }; 47 }