|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.monte.media.Interpolator
org.monte.media.AbstractSplineInterpolator
org.monte.media.SplineInterpolator
public class SplineInterpolator
A spline interpolator for use in conjunction with an Animator object.
This class interpolates fractional values using Bezier splines. The anchor points for the spline are assumed to be (0, 0) and (1, 1). Control points should all be in the range [0, 1].
For more information on how splines are used to interpolate, refer to the SMIL specification at http://w3c.org.
http://www.w3.org/TR/smil/smil-animation.html#animationNS-InterpolationKeysplines
| Constructor Summary | |
|---|---|
SplineInterpolator(float x1,
float y1,
float x2,
float y2)
Creates a new instance of SplineInterpolator with the control points defined by (x1, y1) and (x2, y2). |
|
SplineInterpolator(float x1,
float y1,
float x2,
float y2,
boolean reverse,
long timespan)
Creates a new instance of SplineInterpolator with the control points defined by (x1, y1) and (x2, y2). |
|
SplineInterpolator(float x1,
float y1,
float x2,
float y2,
long timespan)
Creates a new instance of SplineInterpolator with the control points defined by (x1, y1) and (x2, y2). |
|
| Method Summary | |
|---|---|
java.awt.geom.Point2D.Float |
getXY(float t,
java.awt.geom.Point2D.Float p)
Evaluates the spline function at curve parameter time t. |
float |
getY(float t)
Evaluates the spline function at curve parameter time t. |
| Methods inherited from class org.monte.media.AbstractSplineInterpolator |
|---|
getFraction, update, updateFractions |
| Methods inherited from class org.monte.media.Interpolator |
|---|
finish, initialize, interpolate, isElapsed, isFinished, isSequential, replaces, setTimespan |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SplineInterpolator(float x1,
float y1,
float x2,
float y2)
The interpolator runs for one second.
x1 - The x coordinate for the first bezier control point.y1 - The y coordinate for the first bezier control point.x2 - The x coordinate for the second bezier control point.y2 - The x coordinate for the second bezier control point.
java.lang.IllegalArgumentException - This exception is thrown when values
beyond the allowed [0,1] range are passed in
public SplineInterpolator(float x1,
float y1,
float x2,
float y2,
long timespan)
The interpolator runs for the specified time span.
x1 - The x coordinate for the first bezier control point.y1 - The y coordinate for the first bezier control point.x2 - The x coordinate for the second bezier control point.y2 - The x coordinate for the second bezier control point.timespan - The time span in milliseconds.
java.lang.IllegalArgumentException - This exception is thrown when values
beyond the allowed [0,1] range are passed in
public SplineInterpolator(float x1,
float y1,
float x2,
float y2,
boolean reverse,
long timespan)
The interpolator runs for the specified time span.
x1 - The x coordinate for the first bezier control point.y1 - The y coordinate for the first bezier control point.x2 - The x coordinate for the second bezier control point.y2 - The x coordinate for the second bezier control point.reverse - Run interpolator in the reverse direction.timespan - The time span in milliseconds.
java.lang.IllegalArgumentException - This exception is thrown when values
beyond the allowed [0,1] range are passed in| Method Detail |
|---|
public java.awt.geom.Point2D.Float getXY(float t,
java.awt.geom.Point2D.Float p)
getXY in class AbstractSplineInterpolatorpublic float getY(float t)
getY in class AbstractSplineInterpolator
|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||