00001 #ifndef __VECTRACER_GAMEOBJECT_H_ 00002 #define __VECTRACER_GAMEOBJECT_H_ 00003 00004 /* 00005 ----------------------------------------------------------------------------- 00006 Filename: GameObject.h 00007 Description: Basic game object, root for inheritance. 00008 ----------------------------------------------------------------------------- 00009 */ 00010 00011 #include "Common.h" 00012 00015 class GameObject 00016 { 00017 public: 00018 GameObject(); 00019 ~GameObject(); 00020 00021 virtual void setVector(const Ogre::Vector3& _val); 00022 virtual Ogre::Vector3& getVector(); 00023 00024 void setMoveSpeed(const Ogre::Real& _val); 00025 Ogre::Real& getMoveSpeed(); 00026 00027 virtual Ogre::SceneNode* getSceneNode() const; 00028 virtual void setSceneNode(Ogre::SceneNode* _val); 00029 00030 virtual Ogre::Entity* getEntity() const; 00031 virtual void setEntity(Ogre::Entity* _val); 00032 00033 virtual Ogre::BillboardSet* getBillboardSet() const; 00034 virtual void setBillboardSet(Ogre::BillboardSet* _val); 00035 00036 Ogre::ManualObject* getManual() const; 00037 void setManual(Ogre::ManualObject* _val); 00038 00039 virtual std::string getName() const; 00040 virtual void setName(const std::string& _val); 00041 00042 virtual void setAny(); 00043 00045 virtual bool move(Ogre::Real _time); 00046 00047 void setMoveable(const bool _val); 00048 bool getMoveable() const; 00049 00050 int getID() const; 00051 00052 virtual bool makePhysical(); 00053 virtual bool makePhysicalConcave(); 00054 00055 bool getPhysical(); 00056 00057 void setScale(const Ogre::Real& _val); 00058 Ogre::Real& getScale(); 00059 00060 void setCollisionShape(OgreBulletCollisions::CollisionShape* _val); 00061 OgreBulletCollisions::CollisionShape* getCollisionShape(); 00062 00063 void setRigidBody(OgreBulletDynamics::RigidBody *_val); 00064 OgreBulletDynamics::RigidBody* getRigidBody(); 00065 00066 void setRestitution(const Ogre::Real& _val); 00067 Ogre::Real getRestitution() const; 00068 00069 void setFriction(const Ogre::Real& _val); 00070 Ogre::Real getFriction() const; 00071 00072 void setMass(const Ogre::Real& _val); 00073 Ogre::Real getMass() const; 00074 00075 int getType(); 00076 00077 protected: 00078 00079 bool m_physical; 00080 00081 Ogre::Vector3 m_frontVector; 00082 Ogre::Vector3 m_upVector; 00083 00084 Ogre::Vector3 m_vector; 00085 Ogre::Vector3 m_lastMotion; 00086 Ogre::Real m_moveSpeed; 00087 00088 Ogre::SceneNode* m_sceneNode; 00089 Ogre::Entity* m_entity; 00090 Ogre::ManualObject* m_manual; 00091 Ogre::BillboardSet* m_billboardSet; 00092 00093 std::string m_name; 00094 00095 bool m_moveable; 00096 00097 Ogre::Real m_scale; 00098 00099 // Physics attributes 00100 OgreBulletCollisions::CollisionShape* m_collisionShape; 00101 OgreBulletDynamics::RigidBody* m_rigidBody; 00102 Ogre::Real m_restitution; 00103 Ogre::Real m_friction; 00104 Ogre::Real m_mass; 00105 00106 // set ID 00107 virtual void setID(); 00108 00109 int m_ID; 00110 int m_type; 00111 static int s_nextID; 00112 }; 00113 00114 #endif