#include <GameObject.h>

Public Member Functions | |
| GameObject (tGameObjectID id) | |
| Do not construct a game object directly. Use GameObjectDB.NewObject() instead. | |
| ~GameObject () | |
| bool | IsRenderReady () const |
| bool | IsPhysicsReady () const |
| std::string | GetMaterialName () const |
| std::string | GetRenderModelName () const |
| std::string | GetPhysicsModelName () const |
| void | SetMaterialName (const std::string &materialName) |
| void | SetRenderModelName (const std::string &renderModelName) |
| void | SetPhysicsModelName (const std::string &physicsModelName) |
| tGameObjectID | GetID () |
| bool | HasEntity () |
| Ogre::Entity * | GetEntity () |
| void | SetEntity (Ogre::Entity *entity) |
| void | ClearEntity () |
Private Attributes | |
| tGameObjectID | mID |
| Ogre::Entity * | mEntity |
Definition at line 48 of file GameObject.h.
| GameObject::GameObject | ( | tGameObjectID | id | ) |
Do not construct a game object directly. Use GameObjectDB.NewObject() instead.
Definition at line 40 of file GameObject.cpp.
References pcce::PropertyBag::AddProperty(), pcce::kMaterialNameProperty, pcce::kPhysicsModelNameProperty, pcce::kRenderModelNameProperty, and pcce::PropertyBag::SetValue().
00040 : mID(id), mEntity(NULL) { 00041 AddProperty(kMaterialNameProperty); 00042 SetValue(kMaterialNameProperty, ""); 00043 00044 AddProperty(kRenderModelNameProperty); 00045 SetValue(kRenderModelNameProperty, ""); 00046 00047 AddProperty(kPhysicsModelNameProperty); 00048 SetValue(kPhysicsModelNameProperty, ""); 00049 }
| GameObject::~GameObject | ( | ) |
| bool GameObject::IsRenderReady | ( | ) | const |
Definition at line 54 of file GameObject.cpp.
References pcce::PropertyBag::HasValue(), pcce::kMaterialNameProperty, and pcce::kRenderModelNameProperty.
00054 { 00055 return HasValue(kMaterialNameProperty) && HasValue(kRenderModelNameProperty); 00056 }
| bool GameObject::IsPhysicsReady | ( | ) | const |
Definition at line 58 of file GameObject.cpp.
References pcce::PropertyBag::HasValue(), and pcce::kPhysicsModelNameProperty.
00058 { 00059 return HasValue(kPhysicsModelNameProperty); 00060 }
| std::string GameObject::GetMaterialName | ( | ) | const |
Definition at line 62 of file GameObject.cpp.
References pcce::Variant::AsString(), pcce::PropertyBag::GetValueDef(), pcce::Variant::HasValue(), pcce::kMaterialNameProperty, and pcce::Variant::Set().
00062 { 00063 Variant v = GetValueDef(kMaterialNameProperty, ""); 00064 if (!v.HasValue()) { 00065 v.Set(""); 00066 } 00067 return v.AsString(); 00068 }
| std::string GameObject::GetRenderModelName | ( | ) | const |
Definition at line 70 of file GameObject.cpp.
References pcce::Variant::AsString(), pcce::PropertyBag::GetValueDef(), pcce::Variant::HasValue(), pcce::kRenderModelNameProperty, and pcce::Variant::Set().
00070 { 00071 Variant v = GetValueDef(kRenderModelNameProperty, ""); 00072 if (!v.HasValue()) { 00073 v.Set(""); 00074 } 00075 return v.AsString(); 00076 }
| std::string GameObject::GetPhysicsModelName | ( | ) | const |
Definition at line 78 of file GameObject.cpp.
References pcce::Variant::AsString(), pcce::PropertyBag::GetValueDef(), pcce::Variant::HasValue(), pcce::kPhysicsModelNameProperty, and pcce::Variant::Set().
00078 { 00079 Variant v = GetValueDef(kPhysicsModelNameProperty, ""); 00080 if (!v.HasValue()) { 00081 v.Set(""); 00082 } 00083 return v.AsString(); 00084 }
| void GameObject::SetMaterialName | ( | const std::string & | materialName | ) |
Definition at line 86 of file GameObject.cpp.
References pcce::kMaterialNameProperty, mEntity, and pcce::PropertyBag::SetValue().
00086 { 00087 SetValue(kMaterialNameProperty, materialName); 00088 if (mEntity != NULL) { 00089 mEntity->setMaterialName(materialName); 00090 } 00091 }
| void GameObject::SetRenderModelName | ( | const std::string & | renderModelName | ) |
Definition at line 93 of file GameObject.cpp.
References pcce::kRenderModelNameProperty, mEntity, PCCE_CHECK, and pcce::PropertyBag::SetValue().
00093 { 00094 PCCE_CHECK(mEntity == NULL, "GameObject::SetRenderModelName: Cannot change render model after game object has entity"); 00095 SetValue(kRenderModelNameProperty, renderModelName); 00096 }
| void GameObject::SetPhysicsModelName | ( | const std::string & | physicsModelName | ) |
Definition at line 98 of file GameObject.cpp.
References pcce::kPhysicsModelNameProperty, and pcce::PropertyBag::SetValue().
00098 { 00099 SetValue(kPhysicsModelNameProperty, physicsModelName); 00100 }
| tGameObjectID GameObject::GetID | ( | ) |
| bool GameObject::HasEntity | ( | ) |
Definition at line 106 of file GameObject.cpp.
References mEntity.
00106 { 00107 return mEntity == NULL; 00108 }
| Ogre::Entity * GameObject::GetEntity | ( | ) |
Definition at line 110 of file GameObject.cpp.
References mEntity.
00110 { 00111 return mEntity; 00112 }
| void GameObject::SetEntity | ( | Ogre::Entity * | entity | ) |
Definition at line 114 of file GameObject.cpp.
References mEntity, and PCCE_CHECK.
00114 { 00115 PCCE_CHECK( 00116 (mEntity == NULL) || (entity == NULL), "GameObject::SetEntity: Game object already has an entity"); 00117 mEntity = entity; 00118 }
| void GameObject::ClearEntity | ( | ) |
Definition at line 120 of file GameObject.cpp.
References mEntity.
00120 { 00121 mEntity = NULL; 00122 }
tGameObjectID pcce::GameObject::mID [private] |
Ogre::Entity* pcce::GameObject::mEntity [private] |
Definition at line 74 of file GameObject.h.
Referenced by ClearEntity(), GetEntity(), HasEntity(), SetEntity(), SetMaterialName(), and SetRenderModelName().
1.5.5