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). More...
|
|
virtual void | update (float dt, Vec3 *xyz=NULL, Vec3 *hpr=NULL, Vec3 *scale=NULL) |
| Updates the time, position and rotation. More...
|
|
virtual void | getAt (float time, Vec3 *xyz=NULL, Vec3 *hpr=NULL, Vec3 *scale=NULL) |
| Return the time, position and rotation at the specified time. More...
|
|
virtual void | getDerivativeAt (float time, Vec3 *xyz) |
| Returns the derivative at the specified point. More...
|
|
virtual void | update (float dt) |
| This needs to be implemented by the inheriting classes. More...
|
|
void | setInitialTransform (const Vec3 &xyz, const Vec3 &hpr) |
| Stores the initial transform (in the IPOs actually). More...
|
|
void | reset () |
| Resets all IPOs for this animation.
|
|
void | setPlaying (bool playing) |
| Disables or enables an animation. More...
|
|
float | getAnimationDuration () const |
|
|
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). More...
|
|
|
void | calculateAnimationDuration () |
|
A base class for all animations.
◆ AnimTimeType
Two types of animations: cyclic ones that play all the time, and one time only (which might get triggered more than once).
◆ 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. |
◆ setPlaying()
void AnimationBase::setPlaying |
( |
bool |
playing | ) |
|
|
inline |
Disables or enables an animation.
◆ update() [1/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. |
◆ update() [2/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.
◆ m_all_ipos
std::vector<Ipo*> AnimationBase::m_all_ipos |
|
protected |
All IPOs for this animation.
◆ m_current_time
float AnimationBase::m_current_time |
|
protected |
The current time used in the IPOs.
◆ m_initial_hpr
Vec3 AnimationBase::m_initial_hpr |
|
private |
The initial rotation of this object.
◆ m_initial_xyz
Vec3 AnimationBase::m_initial_xyz |
|
private |
The inital position of this object.
◆ m_playing
bool AnimationBase::m_playing |
|
protected |
True if the animation is currently playing.
The documentation for this class was generated from the following files: