SO3Engine
SO3SequenceAnimationTrack.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __SO3_SEQUENCE_ANIMATION_TRACK_H__
26#define __SO3_SEQUENCE_ANIMATION_TRACK_H__
27
30
31namespace SO3
32{
33
35{
36public:
37protected:
38private:
40 float mLength;
41public:
45 SSequenceAnimationTrack(const std::string& animationTrackName, SSequenceAnimation* animation, const unsigned short& trackAnimationId);
46
50
53 SSequenceAnimationKey* AddKey(SAnim* anim, const float& length, const float& transition, const float& decaltime);
54
57 void SetKey(const unsigned int& index, const float& length, const float& transition, const float& decaltime);
58
61 void RemoveKey(SSequenceAnimationKey* key, const bool& reset);
62
65 SSequenceAnimationKey* GetKeyFromIndex(const unsigned int& index);
66
70
73 void RemoveKeysWithAnim(SAnim* anim, const bool& reset);
74
77 void SetLength(const float& length);
78
81 float GetLength();
82
85 void EnableTrackKeys(const bool& enable);
86
89 bool MoveKeyFromIndex(const unsigned int& index, const unsigned int& newindex);
90
93 virtual unsigned short GetNumKeyFrames();
94
97 virtual float GetKeyPositionTime(const unsigned int& keyIndex);
98
101 virtual void RemoveKey(const unsigned int& keyIndex);
102
105 virtual void RemoveAllKeyFrames();
106
109 virtual void Update(const float& pos);
110protected:
111private:
116
119 void UpdateTrackTime();
120};
121
122}
123
124#endif
virtual float GetKeyPositionTime(const unsigned int &keyIndex)
SSequenceAnimationKey * GetKeyFromIndex(const unsigned int &index)
void RemoveKey(SSequenceAnimationKey *key, const bool &reset)
SAnimSequenceKeyList GetKeysFromAnim(SAnim *anim)
SSequenceAnimationKey * AddKey(SAnim *anim, const float &length, const float &transition, const float &decaltime)
virtual void Update(const float &pos)
void RemoveKeysWithAnim(SAnim *anim, const bool &reset)
bool MoveKeyFromIndex(const unsigned int &index, const unsigned int &newindex)
void SetKey(const unsigned int &index, const float &length, const float &transition, const float &decaltime)
std::vector< SSequenceAnimationKey * > SAnimSequenceKeyList