Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
om::physics::shapes::MeshShape Class Reference

A class that represents a triangle mesh shape. More...

#include <omPhysicsMeshShape.h>

Inheritance diagram for om::physics::shapes::MeshShape:
om::physics::shapes::PhysicsShape

Classes

class  Triangle
 A class that is used to specify input triangles for a mesh shape. More...
 

Public Types

typedef UInt32 IndexType
 The type to use for mesh indices. More...
 

Public Member Functions

 MeshShape ()
 Create a new mesh shape with no vertices or triangles. More...
 
IndexType getVertexCount () const
 Return the number of vertices that define the convex hull of this mesh shape. More...
 
void addMesh (const Vector3f *newVertices, IndexType numVertices, const Triangle *newTriangles, IndexType numTriangles)
 Add a new mesh to this mesh shape with the specified vertices and triangles. More...
 
void clearMesh ()
 Remove all vertices and triangles from this mesh shape. More...
 
IndexType getTriangleCount () const
 Return the number of triangles that define the surface of the convex hull of this mesh shape. More...
 
PhysicsMaterialgetMaterial () const
 Return a pointer to the physics material that this mesh shape is using. More...
 
void setMaterial (PhysicsMaterial *newMaterial)
 Set a pointer to the physics material that this mesh shape is using. More...
 
virtual void getMassInfo (Float &mass, Vector3f &massCenter, Matrix3f &inertia) const
 Get the mass distribution for this shape in its local space in the output parameters. More...
 
virtual Float getVolume () const
 Return the volume of this shape in distance units cubed (m^3) in its coordinate frame. More...
 
- Public Member Functions inherited from om::physics::shapes::PhysicsShape
virtual ~PhysicsShape ()
 Destroy this physics shape and all resources it has. More...
 
const AABB3f & getBoundingBox () const
 Return a const reference to the local bounding box of this shape in its coordinate frame. More...
 
ShapeFlagsgetFlags ()
 Return a reference to an object that contains boolean parameters of the shape. More...
 
const ShapeFlagsgetFlags () const
 Return an object that contains boolean parameters of the shape. More...
 
void setFlags (const ShapeFlags &newFlags)
 Set an object that contains boolean parameters of the shape. More...
 
Bool flagIsSet (ShapeFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this shape. More...
 
Bool flagsAreSet (const ShapeFlags &otherFlags) const
 Return whether or not all of the specified boolan flags are set for this shape. More...
 
void setFlag (ShapeFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this shape. More...
 
ShapeTypeID getTypeID () const
 Return an integer identifying the type of this collision shape. More...
 
const ShapeTypegetType () const
 Return an object representing the type of this PhysicsShape. More...
 

Static Public Attributes

static const ShapeType TYPE
 A shape type object that represents the type to use for a mesh shape. More...
 
- Static Public Attributes inherited from om::physics::shapes::PhysicsShape
static const ResourceType RESOURCE_TYPE
 The resource type for a physics shape. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::physics::shapes::PhysicsShape
 PhysicsShape (const ShapeType *newType)
 Create a PhysicsShape object that has the specified subtype. More...
 
void setBoundingBox (const AABB3f &newBoundingBox)
 Set the local-space bounding box to use for this PhysicsShape. More...
 

Detailed Description

A class that represents a triangle mesh shape.

Member Typedef Documentation

The type to use for mesh indices.

Constructor & Destructor Documentation

om::physics::shapes::MeshShape::MeshShape ( )

Create a new mesh shape with no vertices or triangles.

Member Function Documentation

IndexType om::physics::shapes::MeshShape::getVertexCount ( ) const
inline

Return the number of vertices that define the convex hull of this mesh shape.

void om::physics::shapes::MeshShape::addMesh ( const Vector3f *  newVertices,
IndexType  numVertices,
const Triangle newTriangles,
IndexType  numTriangles 
)

Add a new mesh to this mesh shape with the specified vertices and triangles.

void om::physics::shapes::MeshShape::clearMesh ( )

Remove all vertices and triangles from this mesh shape.

IndexType om::physics::shapes::MeshShape::getTriangleCount ( ) const
inline

Return the number of triangles that define the surface of the convex hull of this mesh shape.

PhysicsMaterial* om::physics::shapes::MeshShape::getMaterial ( ) const
inline

Return a pointer to the physics material that this mesh shape is using.

void om::physics::shapes::MeshShape::setMaterial ( PhysicsMaterial newMaterial)
inline

Set a pointer to the physics material that this mesh shape is using.

virtual void om::physics::shapes::MeshShape::getMassInfo ( Float mass,
Vector3f &  massCenter,
Matrix3f &  inertia 
) const
virtual

Get the mass distribution for this shape in its local space in the output parameters.

Implements om::physics::shapes::PhysicsShape.

virtual Float om::physics::shapes::MeshShape::getVolume ( ) const
virtual

Return the volume of this shape in distance units cubed (m^3) in its coordinate frame.

Implements om::physics::shapes::PhysicsShape.

Member Data Documentation

const ShapeType om::physics::shapes::MeshShape::TYPE
static

A shape type object that represents the type to use for a mesh shape.


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