lugre_meshshape.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef LUGRE_MESHSHAPE_H
00025 #define LUGRE_MESHSHAPE_H
00026
00027 #include <vector>
00028 #include <Ogre.h>
00029 #include <OgreVector3.h>
00030
00031 namespace Lugre {
00032
00033 void UnloadMeshShape (const char* szMeshName);
00034
00036 class MeshShape { public :
00037 bool mbInitialised;
00038 Ogre::MeshPtr mpMesh;
00039
00040
00041
00042
00043
00044 Ogre::Vector3 mvMin;
00045 Ogre::Vector3 mvMax;
00046 std::vector<Ogre::Vector3> mlVertices;
00047 std::vector<int> mlIndices;
00048
00049 MeshShape (Ogre::MeshPtr pMesh);
00050 ~MeshShape ();
00051
00052 void Update (Ogre::Entity *pEntity);
00053 void RayIntersect (const Ogre::Vector3& ray_origin,const Ogre::Vector3& ray_dir,std::vector<std::pair<float,int> > &pHitList);
00054 int RayIntersect (const Ogre::Vector3& ray_origin,const Ogre::Vector3& ray_dir,float* pfHitDist=0);
00055
00056 static MeshShape* GetMeshShape (Ogre::Entity* pEntity);
00057 };
00058
00059 bool IntersectRayTriangle (const Ogre::Vector3& ray_origin,const Ogre::Vector3& ray_dir,const Ogre::Vector3& a,const Ogre::Vector3& b,const Ogre::Vector3& c,float* pfHitDist=0,float* pfABC=0);
00060
00061 };
00062
00063 #endif