java.lang.Object
io.sf.carte.echosvg.anim.AbstractAnimation
io.sf.carte.echosvg.anim.InterpolatingAnimation
- Direct Known Subclasses:
MotionAnimation
,SimpleAnimation
An abstract animation class for those animations that interpolate values.
Specifically, this is for animations that have the 'calcMode', 'keyTimes',
'keySplines', 'additive' and 'cumulative' attributes.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Whether this animation adds to ones below it in the animation sandwich or replaces them.protected int
The interpolation mode of this animator.protected boolean
Whether this animation accumulates from previous iterations.protected Cubic[]
Cubics built from the bezier control points inkeySplines
.protected float[]
Bezier control points that control the pacing of the animation.protected float[]
Time values to control the pacing of the animation.Fields inherited from class io.sf.carte.echosvg.anim.AbstractAnimation
animatableElement, beginTime, CALC_MODE_DISCRETE, CALC_MODE_LINEAR, CALC_MODE_PACED, CALC_MODE_SPLINE, composedValue, higherAnimation, isActive, isDirty, isFrozen, lowerAnimation, timedElement, toAnimation, usesUnderlyingValue, value
-
Constructor Summary
ConstructorDescriptionInterpolatingAnimation
(TimedElement timedElement, AnimatableElement animatableElement, int calcMode, float[] keyTimes, float[] keySplines, boolean additive, boolean cumulative) Creates a new InterpolatingAnimation. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
sampledAt
(float simpleTime, float simpleDur, int repeatIteration) Called when the element is sampled at the given time.protected abstract void
sampledAtUnitTime
(float unitTime, int repeatIteration) Called when the element is sampled at the given unit time.protected void
sampledLastValue
(int repeatIteration) Called when the element is sampled for its "last" value.protected boolean
Returns whether this animation will replace values on animations lower in the sandwich.Methods inherited from class io.sf.carte.echosvg.anim.AbstractAnimation
getComposedValue, getTimedElement, getValue, markDirty, toString, usesUnderlyingValue
-
Field Details
-
calcMode
protected int calcModeThe interpolation mode of this animator. This should take one of the CALC_MODE_* constants defined inAbstractAnimation
. -
keyTimes
protected float[] keyTimesTime values to control the pacing of the animation. -
keySplines
protected float[] keySplinesBezier control points that control the pacing of the animation. -
keySplineCubics
Cubics built from the bezier control points inkeySplines
. -
additive
protected boolean additiveWhether this animation adds to ones below it in the animation sandwich or replaces them. -
cumulative
protected boolean cumulativeWhether this animation accumulates from previous iterations.
-
-
Constructor Details
-
InterpolatingAnimation
public InterpolatingAnimation(TimedElement timedElement, AnimatableElement animatableElement, int calcMode, float[] keyTimes, float[] keySplines, boolean additive, boolean cumulative) Creates a new InterpolatingAnimation.
-
-
Method Details
-
willReplace
protected boolean willReplace()Returns whether this animation will replace values on animations lower in the sandwich.- Overrides:
willReplace
in classAbstractAnimation
-
sampledLastValue
protected void sampledLastValue(int repeatIteration) Called when the element is sampled for its "last" value.- Overrides:
sampledLastValue
in classAbstractAnimation
-
sampledAt
protected void sampledAt(float simpleTime, float simpleDur, int repeatIteration) Called when the element is sampled at the given time.- Specified by:
sampledAt
in classAbstractAnimation
-
sampledAtUnitTime
protected abstract void sampledAtUnitTime(float unitTime, int repeatIteration) Called when the element is sampled at the given unit time. This updates theAbstractAnimation.value
of the animation if active.
-