Lugre::MeshShape Class Reference

used for polygon exact ray-intersection More...

#include <lugre_meshshape.h>

Collaboration diagram for Lugre::MeshShape:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MeshShape (Ogre::MeshPtr pMesh)
 ~MeshShape ()
void Update (Ogre::Entity *pEntity)
void RayIntersect (const Ogre::Vector3 &ray_origin, const Ogre::Vector3 &ray_dir, std::vector< std::pair< float, int > > &pHitList)
int RayIntersect (const Ogre::Vector3 &ray_origin, const Ogre::Vector3 &ray_dir, float *pfHitDist=0)

Static Public Member Functions

static MeshShapeGetMeshShape (Ogre::Entity *pEntity)

Public Attributes

bool mbInitialised
 false if still has to be initialised (reads out mesh data only on demand)
Ogre::MeshPtr mpMesh
Ogre::Vector3 mvMin
Ogre::Vector3 mvMax
std::vector< Ogre::Vector3 > mlVertices
std::vector< int > mlIndices


Detailed Description

used for polygon exact ray-intersection

Definition at line 36 of file lugre_meshshape.h.


Constructor & Destructor Documentation

Lugre::MeshShape::MeshShape ( Ogre::MeshPtr  pMesh  ) 

Definition at line 34 of file lugre_meshshape.cpp.

Referenced by GetMeshShape().

Lugre::MeshShape::~MeshShape (  ) 

Definition at line 35 of file lugre_meshshape.cpp.


Member Function Documentation

void Lugre::MeshShape::Update ( Ogre::Entity *  pEntity  ) 

reads out mesh vertices and indices must be called before rayintersect if the mesh has moved/deformed, probably every frame for animated meshes and mousepicking calling it once for static meshes is enough code is based on OgreOpCode MeshCollisionShape::convertMeshData

Definition at line 132 of file lugre_meshshape.cpp.

References mbInitialised, mlIndices, mlVertices, mpMesh, mvMax, and mvMin.

Referenced by GetMeshShape(), and l_IterateOverMeshTriangles().

void Lugre::MeshShape::RayIntersect ( const Ogre::Vector3 &  ray_origin,
const Ogre::Vector3 &  ray_dir,
std::vector< std::pair< float, int > > &  pHitList 
)

int Lugre::MeshShape::RayIntersect ( const Ogre::Vector3 &  ray_origin,
const Ogre::Vector3 &  ray_dir,
float *  pfHitDist = 0 
)

MeshShape * Lugre::MeshShape::GetMeshShape ( Ogre::Entity *  pEntity  )  [static]


Member Data Documentation

false if still has to be initialised (reads out mesh data only on demand)

Definition at line 37 of file lugre_meshshape.h.

Referenced by Update().

Ogre::MeshPtr Lugre::MeshShape::mpMesh

Definition at line 38 of file lugre_meshshape.h.

Referenced by RayIntersect(), and Update().

Ogre::Vector3 Lugre::MeshShape::mvMin

Ogre::Vector3 Lugre::MeshShape::mvMax

std::vector<Ogre::Vector3> Lugre::MeshShape::mlVertices

std::vector<int> Lugre::MeshShape::mlIndices


The documentation for this class was generated from the following files:

Generated on Tue May 22 06:00:42 2012 for cpp by  doxygen 1.5.6