public class CollisionBoxAnimationElement extends AnimationElement
Constructor and Description |
---|
CollisionBoxAnimationElement(IItem item)
Creates an animation element for the supplied item which can then create
the flick motion by repositioning the managed item using JME's animation
system.
|
Modifier and Type | Method and Description |
---|---|
void |
addCollidable(IItem item,
com.jme3.math.Vector2f dimensions) |
void |
elementStart(float tpf)
Called on the first
|
boolean |
isFinished()
When this method returns true, the animation element will be reset.
|
void |
removeCollidable(IItem item) |
void |
reset()
Called when the animation element is finished.
|
void |
updateAnimationState(float tpf)
Called each frame in the game loop.
|
enable, toString, updateState
public CollisionBoxAnimationElement(IItem item)
item
- The item to be influenced by this animation.stage
- The stage the item currently resides in.public void addCollidable(IItem item, com.jme3.math.Vector2f dimensions)
collidables
- the collidables to setpublic void elementStart(float tpf)
AnimationElement
elementStart
in class AnimationElement
public boolean isFinished()
AnimationElement
isFinished
in class AnimationElement
public void removeCollidable(IItem item)
collidables
- the collidable item to removepublic void reset()
AnimationElement
isFinished()
reset
in class AnimationElement
public void updateAnimationState(float tpf)
AnimationElement
updateAnimationState
in class AnimationElement