My Project
MovieCtrlers.h
1 #pragma once
2 #include "BipedController.h"
3 
4 namespace ParaEngine
5 {
13  {
14  public:
15  CMovieCtrler(void);
16  CMovieCtrler(CAIBase* pAI);
17  virtual ~CMovieCtrler(void);
18  private:
23  MovieKeyFrame<PosKey> m_keyframesPos;
25  Vector3 m_vPosOffset;
28  MovieKeyFrame<ActionKey> m_keyframesAction;
30  MovieKeyFrame<EffectKey> m_keyframesEffect;
31 
33  int m_nLastAction;
35  int m_nLastEffect;
37  DWORD m_nLastAnimState;
39  bool m_bHasOffsetPosition:1;
41  bool HasOffsetPosition();
44  MovieKeyFrame<DialogKey> m_keyframesDialog;
46  int m_nLastDialog;
47 
48  public:
49  virtual void SetTime(float fTime);
50  virtual void Resume();
51  virtual void Suspend();
52 
59  void RecordDialogKey(const string& sDialog, float fTime = -1.0f);
60 
69  bool RecordActionKey(const string& sActionName, float fTime = -1.0f);
70  bool RecordActionKey(const ActionKey* actionKey, float fTime = -1.0f);
71 
76  void RecordEffectKey(int effectID, const string& sTarget, float fTime = -1.0f);
77 
79  void DisplayDialog(const string& sDialog);
80 
83  void SetPosOffset(const Vector3& vPos);
85  const Vector3& GetPosOffset();
106  void LoadFromFile(const std::string& filename);
107 
108  enum MovieMode
109  {
110  MOVIE_PLAYING,
111  MOVIE_RECORDING,
112  MOVIE_SUSPENDED
113  };
114  MovieMode m_currentMode;
115 
120  void SetMode(MovieMode mode);
121 
127  void SaveToFile(const std::string& filename);
132  void AddLoopingFrame(float fLoopToTime = 0.f);
133 
138  virtual void FrameMove(float fDeltaTime);
139  };
140 }
void LoadFromFile(const std::string &filename)
load a movie from file.
Definition: MovieCtrlers.cpp:193
void SaveToFile(const std::string &filename)
Save the key frames previously recorded to a specified file.
Definition: MovieCtrlers.cpp:140
key for actions and animations.
Definition: KeyFrame.h:289
virtual void Suspend()
suspend the controller, so it does not take effects on the next frame move.
Definition: MovieCtrlers.cpp:103
different physics engine has different winding order.
Definition: EventBinding.h:32
virtual void FrameMove(float fDeltaTime)
a virtual function which is called every frame to process the controller.
Definition: MovieCtrlers.cpp:382
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
a movie controller it will control the biped to follow a path defined in a movie file or record the b...
Definition: MovieCtrlers.h:12
virtual void Resume()
resume the controller.
Definition: MovieCtrlers.cpp:86
virtual void SetTime(float fTime)
set the internal timer.
Definition: MovieCtrlers.cpp:263
void DisplayDialog(const string &sDialog)
Display a dialog.
Definition: MovieCtrlers.cpp:361
Base Interface for Biped controller.
Definition: BipedController.h:18
void RecordEffectKey(int effectID, const string &sTarget, float fTime=-1.0f)
record the effect key, such as magic and missile effect
Definition: MovieCtrlers.cpp:347
base class for all AI objects
Definition: AIBase.h:9
void SetMode(MovieMode mode)
set the mode for the current movie: there are 4 modes: Playing, Recording, Suspended.
Definition: MovieCtrlers.cpp:120
void AddLoopingFrame(float fLoopToTime=0.f)
It will add an additional key frame to the end, which point to the beginning of the animation...
Definition: MovieCtrlers.cpp:136
void SetPosOffset(const Vector3 &vPos)
Set the position offset.
Definition: MovieCtrlers.cpp:76
bool RecordActionKey(const string &sActionName, float fTime=-1.0f)
Record a action key at the specified time please note that we will only record if it is not playing...
Definition: MovieCtrlers.cpp:313
const Vector3 & GetPosOffset()
get the offset position.
Definition: MovieCtrlers.cpp:81
void RecordDialogKey(const string &sDialog, float fTime=-1.0f)
Record a dialog key at the specified time please note that we will only record if it is not playing...
Definition: MovieCtrlers.cpp:299
Generic movie key frame class: T is the data type stored in the key frame.
Definition: KeyFrame.h:13