A base class for all animations.
More...
#include <animation_base.hpp>
|
| AnimationBase (const XMLNode &node) |
|
| AnimationBase (Ipo *ipo) |
| Special constructor which takes one IPO (or curve).
|
|
virtual void | update (float dt, Vec3 *xyz=NULL, Vec3 *hpr=NULL, Vec3 *scale=NULL) |
| Updates the time, position and rotation.
|
|
virtual void | getAt (float time, Vec3 *xyz=NULL, Vec3 *hpr=NULL, Vec3 *scale=NULL) |
| Return the time, position and rotation at the specified time.
|
|
virtual void | getDerivativeAt (float time, Vec3 *xyz) |
| Returns the derivative at the specified point.
|
|
virtual void | update (float dt) |
| This needs to be implemented by the inheriting classes.
|
|
void | setInitialTransform (const Vec3 &xyz, const Vec3 &hpr) |
| Stores the initial transform (in the IPOs actually).
|
|
void | reset () |
| Resets all IPOs for this animation.
|
|
void | setPlaying (bool playing) |
| Disables or enables an animation.
|
|
float | getAnimationDuration () const |
|
|
std::vector< Ipo * > | m_all_ipos |
| All IPOs for this animation.
|
|
bool | m_playing |
| True if the animation is currently playing.
|
|
float | m_animation_duration |
|
float | m_current_time |
| The current time used in the IPOs.
|
|
|
enum | AnimTimeType { ATT_CYCLIC
, ATT_CYCLIC_ONCE
} |
| Two types of animations: cyclic ones that play all the time, and one time only (which might get triggered more than once).
|
|
|
void | calculateAnimationDuration () |
|
A base class for all animations.
◆ AnimationBase()
AnimationBase::AnimationBase |
( |
Ipo * |
ipo | ) |
|
Special constructor which takes one IPO (or curve).
This is used by the
◆ getAt()
void AnimationBase::getAt |
( |
float |
time, |
|
|
Vec3 * |
xyz = NULL , |
|
|
Vec3 * |
hpr = NULL , |
|
|
Vec3 * |
scale = NULL |
|
) |
| |
|
virtual |
Return the time, position and rotation at the specified time.
It does not update the internal timer as update() does.
- Parameters
-
dt | Time since last call. |
xyz | Position to be updated. |
hpr | Rotation to be updated. |
◆ getDerivativeAt()
void AnimationBase::getDerivativeAt |
( |
float |
time, |
|
|
Vec3 * |
xyz |
|
) |
| |
|
virtual |
Returns the derivative at the specified point.
- Parameters
-
time | The time for which to determine the derivative. |
xyz | Float pointer to store the result. |
◆ setInitialTransform()
void AnimationBase::setInitialTransform |
( |
const Vec3 & |
xyz, |
|
|
const Vec3 & |
hpr |
|
) |
| |
Stores the initial transform (in the IPOs actually).
This is necessary for relative IPOs.
- Parameters
-
xyz | Position of the object. |
hpr | Rotation of the object. |
◆ update() [1/2]
virtual void AnimationBase::update |
( |
float |
dt | ) |
|
|
inlinevirtual |
This needs to be implemented by the inheriting classes.
It is called once per frame from the track. It has a dummy implementation that just asserts so that this class can be instantiated in CannonAnimation.
Reimplemented in ThreeDAnimation.
◆ update() [2/2]
void AnimationBase::update |
( |
float |
dt, |
|
|
Vec3 * |
xyz = NULL , |
|
|
Vec3 * |
hpr = NULL , |
|
|
Vec3 * |
scale = NULL |
|
) |
| |
|
virtual |
Updates the time, position and rotation.
Called once per frame.
- Parameters
-
dt | Time since last call. |
xyz | Position to be updated. |
hpr | Rotation to be updated. |
The documentation for this class was generated from the following files: