Package com.jme3.anim.tween
Class AbstractTween
java.lang.Object
com.jme3.anim.tween.AbstractTween
- All Implemented Interfaces:
- Tween,- JmeCloneable,- Cloneable
Base implementation of the Tween interface that provides
 default implementations of the getLength() and interpolate()
 methods that provide common tween clamping and bounds checking.
 Subclasses need only override the doInterpolate() method and
 the rest is handled for them.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcloneFields(Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned tween into a deep-cloned one, using the specified cloner and original to resolve copied fields.protected abstract voiddoInterpolate(double t) doubleReturns the length of the tween.booleaninterpolate(double t) Default implementation clamps the time value, converts it to 0 to 1.0 based on getLength(), and calls doInterpolate().jmeClone()Create a shallow clone for the JME cloner.voidsetLength(double length) 
- 
Constructor Details- 
AbstractTweenprotected AbstractTween(double length) 
 
- 
- 
Method Details- 
getLengthpublic double getLength()Description copied from interface:TweenReturns the length of the tween. If 't' represents time in seconds then this is the notional time in seconds that the tween will run. Note: all the caveats are because tweens may be externally scaled in such a way that 't' no longer represents actual time.
- 
setLengthpublic void setLength(double length) 
- 
interpolatepublic boolean interpolate(double t) Default implementation clamps the time value, converts it to 0 to 1.0 based on getLength(), and calls doInterpolate().- Specified by:
- interpolatein interface- Tween
- Parameters:
- t- animation time (in de-scaled seconds)
- Returns:
- true if t>length(), otherwise false
 
- 
doInterpolateprotected abstract void doInterpolate(double t) 
- 
jmeCloneCreate a shallow clone for the JME cloner.- Specified by:
- jmeClonein interface- JmeCloneable
- Returns:
- a new tween (not null)
 
- 
cloneFieldsCallback fromClonerto convert this shallow-cloned tween into a deep-cloned one, using the specified cloner and original to resolve copied fields.- Specified by:
- cloneFieldsin interface- JmeCloneable
- Parameters:
- cloner- the cloner that's cloning this tween (not null)
- original- the tween from which this tween was shallow-cloned (unused)
 
 
-