00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_ROTATIONTIMETRACK_H
00012
#define OPENCAL_ROTATIONTIMETRACK_H
00013
00014
00015
#include <OpenCAL/global.h>
00016
#include <OpenCAL/TimeTrack.h>
00017
00018
#include <OpenCAL/Quaternion.h>
00019
using OpenCAL::Utils::Quaternion;
00020
00021
#include <map>
00022
using std::map;
00023
00024
00025
namespace OpenCAL
00026 {
00027
00028
namespace Utils {
class Vector3; }
00029
using Utils::Vector3;
00030
00036 class OPENCAL_API RotationTimeTrack:
public TimeTrack
00037 {
00038
protected:
00039
00040
typedef map<float, Quaternion> KeyFrameMap;
00041
00042
00043 Quaternion *m_rotation;
00044 KeyFrameMap m_keyFrames;
00045
00046
public:
00047
00048 RotationTimeTrack(
KeyFrameSystem *keyFrameSystem, Quaternion *rotation);
00049
virtual ~RotationTimeTrack();
00050
00051
00052
void addKeyFrame(
float time,
const Quaternion &value);
00053
void addKeyFrame(
float time,
const Vector3 &axis,
float angle)
00054 { addKeyFrame(time, Quaternion::createFromAxisAngle(axis, angle)); }
00055
void deleteKeyFrame(
float time);
00056
void apply();
00057 };
00058 }
00059
00060
#endif // OPENCAL_ROTATIONTIMETRACK_H