00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00035 #ifndef __SO3ENTITY_H__
00036 #define __SO3ENTITY_H__
00037
00038 #include "../SCOLBasic/SO3Std.h"
00039 #include "../SCOLBasic/SO3Array.h"
00040 #include "../SO3SceneGraph/SO3NodeScol.h"
00041
00042 namespace SO3
00043 {
00044
00045 class SEntity : public SNode
00046 {
00047 public:
00048 enum EntityPrefabType
00049 {
00050 SO3_PREFAB_PLANE,
00051 SO3_PREFAB_CUBE,
00052 SO3_PREFAB_SPHERE
00053 };
00054 protected:
00055 Ogre::Entity* O3Entity;
00056 SSkeleton* entitySKL;
00057
00058 private:
00059 std::string mGroupName;
00060 typedef boost::unordered_map<std::string, Ogre::ushort> PoseHandleList;
00061 PoseHandleList poseHandleList;
00062 bool mReleaseResource;
00063 std::string mResourceName;
00064 Ogre::MeshPtr mMesh;
00065
00066 public:
00070 SEntity(SScene* parent, std::string groupName, std::string entityName, std::string meshName);
00071
00075 SEntity(SScene* parent, std::string entityName, EntityPrefabType prefabType);
00076
00080 SEntity(SScene* parent, std::string groupName, std::string entityName, SPointFloat sizev, SPointInt seg, SPointFloat uv);
00081
00085 SEntity();
00086
00089 ~SEntity();
00090
00093 Ogre::Entity* getOgreEntityPointer();
00094
00097 SSkeleton* GetSkeleton();
00098
00101 std::string GetGroupName();
00102
00105 void getSubMeshVertices(std::vector<Ogre::Vector3>* vertices,unsigned int index, Ogre::MeshPtr curMesh);
00106
00111 virtual void SetCastShadows(bool castShadows);
00112
00117 virtual bool GetCastShadows();
00118
00123 virtual void SetRenderingDistance(float distance);
00124
00129 virtual float GetRenderingDistance();
00130
00135 virtual Ogre::Vector3 GetBoundingBoxSize(bool childs = false);
00136
00141 virtual Ogre::Vector3 GetBoundingBoxCenter(bool childs = false);
00142
00145 unsigned int GetPolygonCount();
00146
00149 void SetRenderQueue(Ogre::RenderQueueGroupID groupId);
00150
00153 unsigned int GetNumSubEntities();
00154
00157 void SetVisibilityFlags(Ogre::uint32 flags);
00158
00161 Ogre::uint32 GetVisibilityFlags();
00162
00166 void _SetSkeleton(SSkeleton* newSkeleton);
00167
00171 void Reload();
00172 protected:
00173 private:
00177 void CommonConstructorsSequence();
00178 };
00179
00180 }
00181
00182 #endif