00001 #ifndef COMPONENT_H_INCLUDED
00002 #define COMPONENT_H_INCLUDED
00003
00004 #include "CGLA\Vec3f.h"
00005 #include "Object.h"
00006
00007 using namespace CGLA;
00008 class GameObject;
00009
00013 class Component:public Object{
00014 public :
00015 static const RTTI TYPE;
00016 virtual const RTTI& getType() const{ return TYPE; }
00017
00018 protected:
00019 GameObject* gameObject;
00020 bool enabled;
00021
00022 public:
00023 Component();
00024 virtual ~Component();
00025
00026 GameObject* getGameObject();
00027 GameObject const* const getGameObject()const;
00028 void setGameObject(GameObject* obj);
00029
00030 virtual Vec3f getWorldPosition()const;
00031 virtual Vec3f getPosition()const;
00032
00033 private:
00034
00035 friend class boost::serialization::access;
00036 template<class Archive>
00037 void serialize(Archive& ar, const unsigned int version){
00038
00039 ar & boost::serialization::base_object<Object>(*this);
00040
00041
00042 }
00043
00044
00045 };
00046
00047 #endif // COMPONENT_H_INCLUDED