[1919] | 1 | #ifndef __OgreOdeTriangleMeshData_H__ |
---|
| 2 | #define __OgreOdeTriangleMeshData_H__ |
---|
| 3 | |
---|
| 4 | #include "OgreOdePreReqs.h" |
---|
| 5 | |
---|
[1923] | 6 | #include <OgreSharedPtr.h> |
---|
| 7 | #include <OgreVector3.h> |
---|
[1919] | 8 | |
---|
| 9 | namespace OgreOde |
---|
| 10 | { |
---|
| 11 | /** Stores triangle mesh data once and shares it between all geoms that require it |
---|
| 12 | */ |
---|
| 13 | class _OgreOdeExport TriangleMeshData |
---|
| 14 | { |
---|
| 15 | public: |
---|
| 16 | |
---|
| 17 | TriangleMeshData(Ogre::String name, Ogre::Vector3 scale, const Ogre::Vector3* vertices, unsigned int vertex_count, const TriangleIndex* indices, unsigned int index_count); |
---|
| 18 | |
---|
| 19 | virtual ~TriangleMeshData(); |
---|
| 20 | |
---|
| 21 | Ogre::String getMeshName(){ return _name; } |
---|
| 22 | |
---|
| 23 | Ogre::Vector3 getScale(){ return _scale; } |
---|
| 24 | |
---|
| 25 | dTriMeshDataID getData(){ return _data; } |
---|
| 26 | |
---|
| 27 | dVector3* getVertices(){ return _vertices; } |
---|
| 28 | |
---|
| 29 | TriangleIndex* getIndices(){ return _indices; } |
---|
| 30 | |
---|
| 31 | unsigned int getVertexCount(){ return _vertex_count; } |
---|
| 32 | |
---|
| 33 | unsigned int getIndexCount(){ return _index_count; } |
---|
| 34 | |
---|
| 35 | protected: |
---|
| 36 | |
---|
| 37 | Ogre::String _name; |
---|
| 38 | Ogre::Vector3 _scale; |
---|
| 39 | dTriMeshDataID _data; |
---|
| 40 | dVector3* _vertices; |
---|
| 41 | TriangleIndex* _indices; |
---|
| 42 | unsigned int _vertex_count; |
---|
| 43 | unsigned int _index_count; |
---|
| 44 | }; |
---|
| 45 | |
---|
| 46 | /** SharedPtr of TriangleMeshData |
---|
| 47 | */ |
---|
| 48 | class _OgreOdeExport TriangleMeshDataPtr : public Ogre::SharedPtr<TriangleMeshData> |
---|
| 49 | { |
---|
| 50 | public: |
---|
| 51 | TriangleMeshDataPtr() : Ogre::SharedPtr<TriangleMeshData>() {} |
---|
| 52 | TriangleMeshDataPtr(TriangleMeshData* rep) : Ogre::SharedPtr<TriangleMeshData>(rep) {} |
---|
| 53 | TriangleMeshDataPtr(const TriangleMeshDataPtr& r) : Ogre::SharedPtr<TriangleMeshData>(r) {} |
---|
| 54 | }; |
---|
| 55 | |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | #endif //__OgreOdeTriangleMeshData_H__ |
---|
| 59 | |
---|
| 60 | |
---|