00001 #ifndef _ACTOR_H_ 00002 #define _ACTOR_H_ 00003 00004 #include <cmath> 00005 #include <queue> 00006 using namespace std; 00007 00008 #include "Animation.h" 00009 #include "AnimationTypes.h" 00010 #include "Arm.h" 00011 #include "Axe.h" 00012 #include "FrameRate.h" 00013 #include "Leg.h" 00014 #include "Object.h" 00015 #include "Skateboard.h" 00016 #include "Shovel.h" 00017 #include "SuperModel.h" 00018 #include "Terrain.h" 00019 00020 #ifndef M_PI 00021 #define M_PI 3.14159 00022 #endif 00023 00027 class Actor : public Object 00028 { 00029 public: 00030 Actor(string filename = ""); 00031 virtual ~Actor(); 00032 00033 virtual void draw() = 0; 00034 Vector3 walk(double speed); 00035 Vector3 run(double speed); 00036 00037 vector < Inventory * > getInventory() { return _inventory; } 00038 void addInventory(Inventory *v) { _inventory.push_back(v); } 00039 void nextInventory(); 00040 Inventory *getCurrentInventory(){return _currentInventory;} 00041 void putInventoryAway() { _currentInventory = _inventory[0]; } 00042 00043 void addMoney(int i) { _money += i; } 00044 int getMoney() { return _money; } 00045 void subtractMoney(int i) { _money -= i; } 00046 00055 void setAnimationType(int i); 00059 void nextAnimation(); 00060 virtual void update(double time) { _character->Update(time); } 00061 00062 protected: 00067 SuperModel *_character; 00071 UserFunctionTexture *ufTexture; 00077 //vector <unsigned int> _animations; 00078 map < int, unsigned int > _animations; 00079 //unsigned int _currentAnimation; 00080 Animation _currentAnimation; 00081 00086 vector < Inventory * > _inventory; 00087 Inventory *_currentInventory; 00088 00089 // hold the current animation 00090 vector < Animation > _queuedAnimations; 00091 bool _animationStarted; 00092 bool _animationFinished; 00093 double _startAnimationTime; 00094 00095 Vector3 _localRotate; 00096 Vector3 _localTranslate; 00097 00098 int _money; 00099 GLuint _moneyTexture; 00100 }; 00101 00102 #endif