public class InertiaAnimationElement extends AnimationElement
Constructor and Description |
---|
InertiaAnimationElement(IItem item,
IStage stage)
Instantiates a new inertia animation element.
|
Modifier and Type | Method and Description |
---|---|
void |
elementStart(float tpf)
Called on the first
|
float |
getDecelerationFactor()
Gets the deceleration factor.
|
boolean |
isFinished()
When this method returns true, the animation element will be reset.
|
void |
moveWithVelocity(com.jme3.math.Vector2f velocity)
Move with velocity.
|
void |
reset()
Called when the animation element is finished.
|
void |
setDeceleration(float deceleration)
Sets the deceleration.
|
void |
updateAnimationState(float tpf)
Called each frame in the game loop.
|
enable, toString, updateState
public void elementStart(float tpf)
AnimationElement
elementStart
in class AnimationElement
public float getDecelerationFactor()
public boolean isFinished()
AnimationElement
isFinished
in class AnimationElement
public void moveWithVelocity(com.jme3.math.Vector2f velocity)
velocity
- the velocitypublic void reset()
AnimationElement
isFinished()
reset
in class AnimationElement
public void setDeceleration(float deceleration)
deceleration
- the new decelerationpublic void updateAnimationState(float tpf)
AnimationElement
updateAnimationState
in class AnimationElement