Package yearreview.app.animation
Class AnimationCurveControlPoint
java.lang.Object
yearreview.app.animation.AnimationCurveControlPoint
A Control point used in the Creation of an
AnimationCurve
.- Author:
- ColdStone37
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAnimationCurveControlPoint
(float x, float y) Constructs a Control-Point from a position.AnimationCurveControlPoint
(float x, float y, float dx, float dy) Constructs a Control-Point from a position and direction.Constructs a Control-Point from a position.AnimationCurveControlPoint
(Vector2D pos, Vector2D dir) Constructs a Control-Point from a position and direction. -
Method Summary
Modifier and TypeMethodDescriptionprotected static BezierCurve
Constructs aBezier
between two Control-Points.boolean
Whether this ControlPoint has a direction/handle.toString()
Outputs a text representation of the Control-Point.
-
Field Details
-
pos
Position of the Control-Point. -
dir
Direction of the Control-Point. The x-value of this vector will always be positive.
-
-
Constructor Details
-
AnimationCurveControlPoint
Constructs a Control-Point from a position and direction. If the direction has a negative x-value the direction-vector will be inverted.- Parameters:
pos
- position of the Control-Pointdir
- direction of the Control-Point
-
AnimationCurveControlPoint
Constructs a Control-Point from a position. The resulting Control-Point will not have a direction/handle.- Parameters:
pos
- position of the Control-Point
-
AnimationCurveControlPoint
public AnimationCurveControlPoint(float x, float y, float dx, float dy) Constructs a Control-Point from a position and direction.- Parameters:
x
- x-coordinate of the Control-Pointy
- y-coordinate of the Control-Pointdx
- x-direction of the Control-Pointdy
- y-direction of the Control-Point
-
AnimationCurveControlPoint
public AnimationCurveControlPoint(float x, float y) Constructs a Control-Point from a position.- Parameters:
x
- x-coordinate of the Control-Pointy
- y-coordinate of the Control-Point
-
-
Method Details
-
hasHandle
public boolean hasHandle()Whether this ControlPoint has a direction/handle.- Returns:
- true if the ControlPoint has a direction, false otherwise
-
constructBezierBetween
protected static BezierCurve constructBezierBetween(AnimationCurveControlPoint p1, AnimationCurveControlPoint p2) Constructs aBezier
between two Control-Points.- Parameters:
p1
- start of Bezierp2
- end of Bezier- Returns:
- Bezier Curve from p1 to p2
-
toString
Outputs a text representation of the Control-Point. (e.g. "pos: (0.1, 0.3) dir: (0.5, 0.75)")
-