1 | #ifndef _OGREODEENTITYINFORMER_H_ |
---|
2 | #define _OGREODEENTITYINFORMER_H_ |
---|
3 | |
---|
4 | #include "OgreOdePreReqs.h" |
---|
5 | |
---|
6 | namespace OgreOde |
---|
7 | { |
---|
8 | class _OgreOdeExport EntityInformer |
---|
9 | { |
---|
10 | public: |
---|
11 | EntityInformer(Ogre::Entity *entity,const Ogre::Matrix4 &transform = Ogre::Matrix4::IDENTITY); |
---|
12 | EntityInformer(); |
---|
13 | ~EntityInformer(); |
---|
14 | |
---|
15 | void addEntity(Ogre::Entity *entity,const Ogre::Matrix4 &transform = Ogre::Matrix4::IDENTITY); |
---|
16 | // Cannot be animated. |
---|
17 | void addMesh(const Ogre::MeshPtr &mesh, const Ogre::Matrix4 &transform = Ogre::Matrix4::IDENTITY); |
---|
18 | |
---|
19 | Ogre::Real getRadius(); |
---|
20 | Ogre::Vector3 getSize(); |
---|
21 | |
---|
22 | Body* createSingleDynamicSphere(Ogre::Real mass, World *world, Space* space = 0); |
---|
23 | Body* createSingleDynamicBox(Ogre::Real mass, World *world, Space* space = 0); |
---|
24 | |
---|
25 | TriangleMeshGeometry* createStaticTriangleMesh(World *world, Space* space = 0); |
---|
26 | BoxGeometry* createSingleStaticBox(World *world, Space* space = 0); |
---|
27 | |
---|
28 | CapsuleGeometry* createOrientedCapsule(unsigned char bone, World *world, Space* space = 0); |
---|
29 | BoxGeometry* createOrientedBox(unsigned char bone, World *world, Space* space = 0); |
---|
30 | BoxGeometry* createAlignedBox(unsigned char bone, World *world, Space* space = 0); |
---|
31 | |
---|
32 | const Ogre::Vector3* getVertices(); |
---|
33 | unsigned int getVertexCount(); |
---|
34 | const unsigned int* getIndices(); |
---|
35 | unsigned int getIndexCount(); |
---|
36 | |
---|
37 | protected: |
---|
38 | void addVertexData(const Ogre::VertexData *vertex_data, |
---|
39 | const Ogre::VertexData *blended_data = 0, |
---|
40 | const Ogre::Mesh::IndexMap *indexMap = 0); |
---|
41 | void addIndexData(Ogre::IndexData *data, const unsigned int offset = 0); |
---|
42 | bool getBoneVertices(unsigned char bone,unsigned int &vertex_count, Ogre::Vector3* &vertices); |
---|
43 | |
---|
44 | Ogre::Entity* _entity; |
---|
45 | Ogre::SceneNode* _node; |
---|
46 | Ogre::Matrix4 _transform; |
---|
47 | |
---|
48 | Ogre::Real _radius; |
---|
49 | Ogre::Vector3 _size; |
---|
50 | |
---|
51 | Ogre::Vector3* _vertices; |
---|
52 | unsigned int* _indices; |
---|
53 | unsigned int _vertex_count; |
---|
54 | unsigned int _index_count; |
---|
55 | |
---|
56 | |
---|
57 | BoneMapping *_bone_mapping; |
---|
58 | }; |
---|
59 | } |
---|
60 | |
---|
61 | #endif |
---|
62 | |
---|
63 | |
---|