Package yearreview.app.animation
Class BezierCurve
java.lang.Object
yearreview.app.animation.BezierCurve
A Bezier-Curve used for calculation of smooth animations.
- Author:
- ColdStone37
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBezierCurve
(List<Vector2D> controlPoints) Constructs a new BezierCurve from a list of Control-Points.BezierCurve
(Vector2D... controlPoints) Constructs a new BezierCurve from atleast two Control-Points. -
Method Summary
-
Field Details
-
controlPoints
Array of Control-Points of the curve.
-
-
Constructor Details
-
BezierCurve
Constructs a new BezierCurve from atleast two Control-Points.- Parameters:
controlPoints
- Control-Points of the Bezier
-
BezierCurve
Constructs a new BezierCurve from a list of Control-Points.- Parameters:
controlPoints
- Control-Points of the Bezier
-
-
Method Details
-
samplePoint
Samples the Bezier at a certain point along the curve.- Parameters:
val
- how far along the curve- Returns:
- sampled position
-
getStart
Gets the first Control-Point of the Bezier.- Returns:
- first Control-Point
-
getEnd
Gets the last Control-Point of the Bezier.- Returns:
- last Control-Point
-