public class BezierInterpolator extends AbstractSplineInterpolator
This class interpolates fractional values using a Bezier spline. 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].
FIXME - This interpolator does not work!
Constructor and Description |
---|
BezierInterpolator(double[][] controlPoints)
Interpolates between the specified control points.
|
BezierInterpolator(double[][] controlPoints,
boolean reverse,
long timespan)
Interpolates between the specified control points.
|
BezierInterpolator(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).
|
BezierInterpolator(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).
|
BezierInterpolator(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).
|
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Point2D.Float |
getXY(float t,
java.awt.geom.Point2D.Float xy)
Evaluates the bezier function and returns a 2D point.
|
float |
getY(float t)
Evaluates the bezier function and returns a 2D point.
|
getFraction, update, updateFractions
finish, initialize, interpolate, isElapsed, isFinished, isSequential, replaces, setTimespan
public BezierInterpolator(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 inpublic BezierInterpolator(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 inpublic BezierInterpolator(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 inpublic BezierInterpolator(double[][] controlPoints)
controlPoints
- The control points of the bezier path. Must include
the first and the last control point. The curve must be in the range [0,1].public BezierInterpolator(double[][] controlPoints, boolean reverse, long timespan)
controlPoints
- The control points of the bezier path. Must include
the first and the last control point. The curve must be in the range [0,1].public java.awt.geom.Point2D.Float getXY(float t, java.awt.geom.Point2D.Float xy)
getXY
in class AbstractSplineInterpolator
public float getY(float t)
getY
in class AbstractSplineInterpolator