19#ifndef HEADER_ANIMATION_BASE_HPP
20#define HEADER_ANIMATION_BASE_HPP
31#include "utils/vec3.hpp"
53 void calculateAnimationDuration();
62 float m_animation_duration;
73 virtual void getAt(
float time,
Vec3 *xyz = NULL,
Vec3 *hpr = NULL,
80 virtual void update(
float dt) {assert(
false); };
89 float getAnimationDuration()
const {
return m_animation_duration; }
A base class for all animations.
Definition: animation_base.hpp:41
virtual void getAt(float time, Vec3 *xyz=NULL, Vec3 *hpr=NULL, Vec3 *scale=NULL)
Return the time, position and rotation at the specified time.
Definition: animation_base.cpp:138
std::vector< Ipo * > m_all_ipos
All IPOs for this animation.
Definition: animation_base.hpp:57
void reset()
Resets all IPOs for this animation.
Definition: animation_base.cpp:100
float m_current_time
The current time used in the IPOs.
Definition: animation_base.hpp:65
void setInitialTransform(const Vec3 &xyz, const Vec3 &hpr)
Stores the initial transform (in the IPOs actually).
Definition: animation_base.cpp:88
AnimTimeType
Two types of animations: cyclic ones that play all the time, and one time only (which might get trigg...
Definition: animation_base.hpp:45
bool m_playing
True if the animation is currently playing.
Definition: animation_base.hpp:60
void setPlaying(bool playing)
Disables or enables an animation.
Definition: animation_base.hpp:86
virtual void update(float dt)
This needs to be implemented by the inheriting classes.
Definition: animation_base.hpp:80
Vec3 m_initial_hpr
The initial rotation of this object.
Definition: animation_base.hpp:51
virtual void getDerivativeAt(float time, Vec3 *xyz)
Returns the derivative at the specified point.
Definition: animation_base.cpp:156
virtual void update(float dt, Vec3 *xyz=NULL, Vec3 *hpr=NULL, Vec3 *scale=NULL)
Updates the time, position and rotation.
Definition: animation_base.cpp:115
Vec3 m_initial_xyz
The inital position of this object.
Definition: animation_base.hpp:48
A class to manage a single blender IPO curve.
Definition: ipo.hpp:38
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48