00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __MESHCOMPONENT_H__
00017 #define __MESHCOMPONENT_H__
00018
00019
00020 #include "../../dependencies.h"
00021 #include "SceneComponent.h"
00022
00023
00024
00033 class MeshComponent : public SceneComponent
00034 {
00035 public:
00036
00037
00040 MeshComponent(Entity *parent);
00045 MeshComponent(Entity *parent, const std::string &fileName,
00046 const vector3df &scale = vector3df(1.0f, 1.0f, 1.0f));
00052 MeshComponent(Entity *parent, IMesh *mesh,
00053 const vector3df &scale = vector3df(1.0f, 1.0f, 1.0f));
00055 ~MeshComponent();
00056
00057
00060 IMeshSceneNode* getMeshSceneNode();
00061
00064 IMesh* getMesh();
00065
00074 virtual void setMesh(const std::string &fileName);
00078 virtual void setMesh(IMesh *mesh);
00079
00080
00083 void onMesh(void *p);
00084
00085
00088 static bool parseXML(IXMLReader *file, Entity *entity);
00091 static bool parseBaseXML(IXMLReader *file, MeshComponent *component);
00092
00093 protected:
00094
00095
00097 MeshComponent(Entity *parent, bool isDerived);
00098
00099
00100 IMeshSceneNode *mMeshSN;
00101 std::string mMeshFileName;
00102
00103 private:
00104
00105
00107 void init(const vector3df &scale = vector3df(1.0f, 1.0f, 1.0f));
00108 };
00109
00110 #endif
00111