Track::BulletMesh Class Reference

A DrawableMesh which can produce shapes for the Bullet physics library. More...

#include <BulletMesh.h>

Inheritance diagram for Track::BulletMesh:

Track::DrawableMesh Track::AABBDrawable Track::MeshFaces Track::Drawable Track::AABBBounded Track::AABBBounded List of all members.

Public Types

typedef std::pair< std::string,
unsigned int > 
ConstructionInformation
 A type used to construct the mesh. Works exactly like Mesh(std::string, unsigned int).

Public Member Functions

 BulletMesh (std::string filename, unsigned int generators=genererator_triangle_mesh_bit, DrawableMesh::RenderMode render_mode=DrawableMesh::RM_SOLID)
 Construct some objects from the mesh specifed by the file given.
 BulletMesh (std::istream &source, unsigned int generators=genererator_triangle_mesh_bit, DrawableMesh::RenderMode render_mode=DrawableMesh::RM_SOLID)
 Construct some objects from the mesh specified by a stream.
 BulletMesh (ConstructionInformation construction_information)
 Construct from a ConstructionInformation object.
virtual ~BulletMesh ()
btConvexHullShape * get_convex_hull_shape ()
 Get the convex hull of the vertices in the mesh.
btBvhTriangleMeshShape * get_triangle_shape ()
 Get a Bullet btBvhTriangleMeshShape representing the faces in the mesh.

Static Public Attributes

static const unsigned int genererator_convex_hull_bit = 2
 bit mask to create a convex hull of the points in the mesh for bullet.
static const unsigned int genererator_triangle_mesh_bit = 4
 bit mask to create a triangle mesh of the mesh for bullet.

Private Member Functions

 BulletMesh (const BulletMesh &source)
BulletMeshoperator= (const BulletMesh &source)
void create (unsigned int generators=genererator_triangle_mesh_bit)
 Create the triangle / convex hull shape.

Private Attributes

btConvexHullShape * simplified_convex_shape
btBvhTriangleMeshShape * triangle_mesh_shape
btTriangleMesh * triangle_mesh

Detailed Description

A DrawableMesh which can produce shapes for the Bullet physics library.

When created you should use bit masks for the type of shape you want to produce: a convex hull (fastest for moving objects), a triangle mesh for the bullet physics library (good for static geometry), or both.

Definition at line 34 of file BulletMesh.h.


Member Typedef Documentation

typedef std::pair<std::string, unsigned int> Track::BulletMesh::ConstructionInformation

A type used to construct the mesh. Works exactly like Mesh(std::string, unsigned int).

Definition at line 69 of file BulletMesh.h.


Constructor & Destructor Documentation

Track::BulletMesh::BulletMesh ( const BulletMesh source  )  [private]

Track::BulletMesh::BulletMesh ( std::string  filename,
unsigned int  generators = genererator_triangle_mesh_bit,
DrawableMesh::RenderMode  render_mode = DrawableMesh::RM_SOLID 
)

Construct some objects from the mesh specifed by the file given.

Parameters:
filename The name and path of a file containing the mesh to load.
generators A bit mask made from the above three constants to determine which objects to create.
render_mode The method to use to draw the mesh.

Definition at line 25 of file BulletMesh.cpp.

Track::BulletMesh::BulletMesh ( std::istream &  source,
unsigned int  generators = genererator_triangle_mesh_bit,
DrawableMesh::RenderMode  render_mode = DrawableMesh::RM_SOLID 
)

Construct some objects from the mesh specified by a stream.

Parameters:
generators A bit mask made from the generator constants to determine which objects to create.
source The stream to load the mesh from.
render_mode The method to use to draw the mesh.

Definition at line 34 of file BulletMesh.cpp.

Track::BulletMesh::BulletMesh ( ConstructionInformation  construction_information  ) 

Construct from a ConstructionInformation object.

Definition at line 43 of file BulletMesh.cpp.

Track::BulletMesh::~BulletMesh (  )  [virtual]

Definition at line 102 of file BulletMesh.cpp.


Member Function Documentation

void Track::BulletMesh::create ( unsigned int  generators = genererator_triangle_mesh_bit  )  [private]

Create the triangle / convex hull shape.

Definition at line 52 of file BulletMesh.cpp.

btConvexHullShape * Track::BulletMesh::get_convex_hull_shape (  ) 

Get the convex hull of the vertices in the mesh.

It should be efficent for calculating physics when used for a moving object.

Returns:
Pointer to convex hull shape, which deleted with the BulletMesh.

Definition at line 110 of file BulletMesh.cpp.

btBvhTriangleMeshShape * Track::BulletMesh::get_triangle_shape (  ) 

Get a Bullet btBvhTriangleMeshShape representing the faces in the mesh.

It is uesful for static geometry.

Returns:
Pointer to triangle mesh shape, which deleted with the BulletMesh.

Definition at line 115 of file BulletMesh.cpp.

BulletMesh& Track::BulletMesh::operator= ( const BulletMesh source  )  [private]


Member Data Documentation

const unsigned int Track::BulletMesh::genererator_convex_hull_bit = 2 [static]

bit mask to create a convex hull of the points in the mesh for bullet.

Definition at line 43 of file BulletMesh.h.

const unsigned int Track::BulletMesh::genererator_triangle_mesh_bit = 4 [static]

bit mask to create a triangle mesh of the mesh for bullet.

Definition at line 45 of file BulletMesh.h.

btConvexHullShape* Track::BulletMesh::simplified_convex_shape [private]

Definition at line 93 of file BulletMesh.h.

btTriangleMesh* Track::BulletMesh::triangle_mesh [private]

Definition at line 95 of file BulletMesh.h.

btBvhTriangleMeshShape* Track::BulletMesh::triangle_mesh_shape [private]

Definition at line 94 of file BulletMesh.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:18 2010 by Doxygen version 1.4.7 for Racer version svn335.