com.hdcookbook.grin.features.parts
Class PointsEasingEquation
java.lang.Object
com.hdcookbook.grin.features.parts.EasingEquation
com.hdcookbook.grin.features.parts.PointsEasingEquation
public class PointsEasingEquation
- extends EasingEquation
This class represents an degenerate case of an easing function that
consists of just listing the in between points. It can be used by the
GRIN compiler to generate a linear interpolation that approximates that
list of points within a certain error.
Method Summary |
void |
addKeyFrames(java.util.ArrayList<int[]> keyFrames,
int[] end)
Approximate this easing function with linear interpolation segments,
making sure that the error doesn't exceed maxError units. |
double |
evaluate(double t,
double b,
double c,
double d)
Evaluate the eqsing equation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PointsEasingEquation
public PointsEasingEquation(int[][] points)
addKeyFrames
public void addKeyFrames(java.util.ArrayList<int[]> keyFrames,
int[] end)
throws java.io.IOException
- Description copied from class:
EasingEquation
- Approximate this easing function with linear interpolation segments,
making sure that the error doesn't exceed maxError units. We start
the easing from keyFrames[size-1], and add to keyFrames.
- Overrides:
addKeyFrames
in class EasingEquation
- Parameters:
keyFrames
- a list of { frame#, value, ... } int arraysend
- Where to ease to, { frame#, value, ... }
- Throws:
java.io.IOException
evaluate
public double evaluate(double t,
double b,
double c,
double d)
- Description copied from class:
EasingEquation
- Evaluate the eqsing equation.
- Specified by:
evaluate
in class EasingEquation
- Parameters:
t
- current time in frames, seconds, or any other unitb
- beginning valuec
- change in valued
- duration in frames, seconds, or any other unit