public abstract class AbstractSplineInterpolator extends Interpolator
AbstractSplineInterpolator
.Constructor and Description |
---|
AbstractSplineInterpolator() |
AbstractSplineInterpolator(boolean reverse)
Creates a new interpolator which interpolates into the specified
direction within one second.
|
AbstractSplineInterpolator(float startValue,
float endValue)
Creates a new interpolator which interpolates from the specified
start value to the specified end value within one second.
|
AbstractSplineInterpolator(float startValue,
float endValue,
long timespan)
Creates a new interpolator which interpolates from the specified
start value to the specified end value within the specified timespan.
|
AbstractSplineInterpolator(long timespan)
Creates a new interpolator which interpolates from 0 to 1 within the
specified timespan.
|
Modifier and Type | Method and Description |
---|---|
float |
getFraction(float t)
Evaluates the spline function at time t, and clamps the result value between 0
and 1.
|
protected abstract java.awt.geom.Point2D.Float |
getXY(float t,
java.awt.geom.Point2D.Float p)
Evaluates the spline function at curve parameter time t.
|
protected abstract float |
getY(float t)
Evaluates the spline function at curve parameter time t.
|
protected void |
update(float fraction)
This method is empty.
|
protected void |
updateFractions(int N)
This method must be called by the subclass in the constructor.
|
finish, initialize, interpolate, isElapsed, isFinished, isSequential, replaces, setTimespan
public AbstractSplineInterpolator()
public AbstractSplineInterpolator(long timespan)
public AbstractSplineInterpolator(boolean reverse)
reverse
- Set this to true, if you want to interpolate from 1 to 0
instead of from 0 to 1.public AbstractSplineInterpolator(float startValue, float endValue)
startValue
- A value between 0 and 1.endValue
- A value between 0 and 1.public AbstractSplineInterpolator(float startValue, float endValue, long timespan)
startValue
- A value between 0 and 1.endValue
- A value between 0 and 1.timespan
- A timespan in milliseconds.protected void updateFractions(int N)
N
- public final float getFraction(float t)
getFraction
in class Interpolator
t
- The linear fraction between 0 and 1.protected abstract java.awt.geom.Point2D.Float getXY(float t, java.awt.geom.Point2D.Float p)
protected abstract float getY(float t)
protected void update(float fraction)
update
in class Interpolator
fraction
- An interpolated fraction between 0 and 1.