Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HBhvTimeline.h
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: 413cef47c03b60eacbbba6baac1ab16fefec0389 $
13 //
14 #ifndef _H_HBhvTimeline_H
15 #define _H_HBhvTimeline_H
16 
17 #ifdef H_PACK_8
18 #pragma pack(push)
19 #pragma pack(8)
20 #endif
21 
22 #include "HTools.h"
23 #include "varray.h"
24 
25 
26 class HBhvTimelineInstance;
27 class HUtilityXMLGenerator;
28 class HUtilityXMLTag;
29 class HBhvAnimation;
30 
31 
32 #ifdef WINDOWS_SYSTEM
33 template class MVO_API VArray< int >;
34 #endif
35 
37 
42 class MVO_API HBhvTimeline
43 {
44 public:
49  HBhvTimeline(HBhvAnimation *animation = 0);
50  virtual ~HBhvTimeline() { };
51 
57  void SetTimeline(const int *timeline, int length);
58 
63  void SetAnimation(HBhvAnimation *animation) { m_pAnimation = animation; }
64 
73 
76  int * GetTimelineArray() { return &m_pTimelineArray[0]; }
77 
79  int GetTimelineArrayLength() { return m_pTimelineArray.Count(); }
80 
87  int AddKeyframe(int t, bool &doesExist);
93  int AddKeyframe(int t);
99  int DeleteKeyframe(int t);
100 
106  int CheckKeyframe(int t);
107 
111  void Serialize(HUtilityXMLGenerator *xmlgen);
112 
116  static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
117 
119  int GetLastTick();
120 
128  bool GetTimelineInterval(int currentTick, int &interval);
129 
134  void SetStartTick(float starttick) { m_StartTick = starttick; }
135 
137  float GetStartTick() { return m_StartTick; }
138 
146  virtual bool Evaluate (float currentTick, int &interval, float &fraction);
147 
149  HBhvAnimation *GetAnimation() { return m_pAnimation; }
150 
152  float GetCurrentTick() { return m_CurrentTick; }
153 
158  void SetInstancedTimeline(HBhvTimeline *timeline) { m_pInstancedTimeline = timeline; }
159 
166  void Adjust(int time, int delta, bool doall = true);
174  void AdjustRelative(int time, int delta);
175 
178  float GetCurrentRelativeTick() { return m_CurrentRelativeTick; }
179 
184  void SetCurrentRelativeTick(float tick) { m_CurrentRelativeTick = tick; }
185 
186 
187 
188 protected:
195  int AddKeyframeInternal(int t, bool *doesExist);
202  float AdjustTickToTimeline(float tick);
203  VArray< int > m_pTimelineArray;
204 
207 
208  float m_StartTick;
211  private:
212 };
213 
214 
215 
216 #ifdef H_PACK_8
217 #pragma pack(pop)
218 #endif
219 
220 #endif
221 
222 
223 
The HBhvTimeline class encpasulates an animation timeline.
Definition: HBhvTimeline.h:42
void SetAnimation(HBhvAnimation *animation)
Definition: HBhvTimeline.h:63
void SetInstancedTimeline(HBhvTimeline *timeline)
Definition: HBhvTimeline.h:158
float GetCurrentTick()
Definition: HBhvTimeline.h:152
void DeleteKeyframe(int keyframe)
void SetCurrentRelativeTick(float tick)
Definition: HBhvTimeline.h:184
VArray< int > m_pTimelineArray
This is for internal use only.
Definition: HBhvTimeline.h:203
int GetTimelineArrayLength()
Definition: HBhvTimeline.h:79
float GetCurrentRelativeTick()
Definition: HBhvTimeline.h:178
float GetStartTick()
Definition: HBhvTimeline.h:137
HBhvAnimation * CreateInstance()
int * GetTimelineArray()
Definition: HBhvTimeline.h:76
virtual void Serialize(HUtilityXMLGenerator *xmlgen, HUtilityXMLTag *xmlt)
The HBhvAnimation class defines an animation.
Definition: HBhvAnimation.h:47
HBhvAnimation * GetAnimation()
Definition: HBhvTimeline.h:149
float m_CurrentRelativeTick
This is for internal use only.
Definition: HBhvTimeline.h:210
HBhvTimeline * m_pInstancedTimeline
This is for internal use only.
Definition: HBhvTimeline.h:206
static void * XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData)
void SetStartTick(float starttick)
Definition: HBhvTimeline.h:134
float m_CurrentTick
This is for internal use only.
Definition: HBhvTimeline.h:209
HBhvAnimation * m_pAnimation
This is for internal use only.
Definition: HBhvTimeline.h:205
float m_StartTick
This is for internal use only.
Definition: HBhvTimeline.h:208
void SetTimeline(HBhvTimeline *timeline)