|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.hdcookbook.grin.features.parts.EasingEquation
public abstract class EasingEquation
This abstract class represents an easing function that can be used by the GRIN compiler to generate a linear interpolation. See ShowParser to see how to tie this to a particular easing function.
| Field Summary | |
|---|---|
static int |
framesAdded
Total number of keyframes added to approximate interpolations. |
| Constructor Summary | |
|---|---|
EasingEquation()
|
|
| 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. |
abstract double |
evaluate(double t,
double b,
double c,
double d)
Evaluate the eqsing equation. |
void |
setMaxError(int maxError)
Set the maximum allowed error when generating linear interpolations from this equation. |
protected void |
trimUnneededKeyFrames(int startFrame,
java.util.ArrayList<int[]> keyFrames,
int[] end,
int[][] allFrames)
Approximate the list of keyFrames with a reduced list, within the error band of this easing equation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int framesAdded
| Constructor Detail |
|---|
public EasingEquation()
| Method Detail |
|---|
public abstract double evaluate(double t,
double b,
double c,
double d)
t - current time in frames, seconds, or any other unitb - beginning valuec - change in valued - duration in frames, seconds, or any other unitpublic void setMaxError(int maxError)
public void addKeyFrames(java.util.ArrayList<int[]> keyFrames,
int[] end)
throws java.io.IOException
keyFrames - a list of { frame#, value, ... } int arraysend - Where to ease to, { frame#, value, ... }
java.io.IOException
protected void trimUnneededKeyFrames(int startFrame,
java.util.ArrayList<int[]> keyFrames,
int[] end,
int[][] allFrames)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||