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

A class that represents a convex polyhedral shape. More...

#include <omPhysicsConvexShape.h>

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

Public Member Functions

 ConvexShape ()
 Create a convex shape with no vertices or triangles. More...
 
 ConvexShape (const Vector3f *vertices, UInt32 numVertices)
 Create a convex shape with the specified vertices. More...
 
UInt32 getVertexCount () const
 Return the number of vertices that define the convex hull of this convex shape. More...
 
const base::ConvexHull::VertexgetVertex (UInt32 index) const
 Return the convex hull vertex at the specified index in this convex shape. More...
 
void addVertices (const Vector3f *newVertices, UInt32 numVertices)
 Add an array of new vertices to the convex shape and update the shape's convex hull. More...
 
void clearVertices ()
 Remove all vertices and triangles from this convex shape. More...
 
UInt32 getTriangleCount () const
 Return the number of triangles that define the surface of the convex hull of this convex shape. More...
 
const base::ConvexHull::TrianglegetTriangle (UInt32 index) const
 Return the triangle at the specified index in this convex shape. More...
 
PhysicsMaterialgetMaterial () const
 Return a pointer to the physics material that this convex shape is using. More...
 
void setMaterial (PhysicsMaterial *newMaterial)
 Set a pointer to the physics material that this convex 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 Member Functions

static SIMDFloat4 getSupportPoint (const ConvexShape *convex, const SIMDFloat4 &direction)
 Return the point on the specified convex that is farthest in the given normalized direction. More...
 

Static Public Attributes

static const ShapeType TYPE
 A shape type object that represents the type to use for a convex 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 convex polyhedral shape.

Constructor & Destructor Documentation

om::physics::shapes::ConvexShape::ConvexShape ( )

Create a convex shape with no vertices or triangles.

om::physics::shapes::ConvexShape::ConvexShape ( const Vector3f *  vertices,
UInt32  numVertices 
)

Create a convex shape with the specified vertices.

Member Function Documentation

UInt32 om::physics::shapes::ConvexShape::getVertexCount ( ) const
inline

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

const base::ConvexHull::Vertex& om::physics::shapes::ConvexShape::getVertex ( UInt32  index) const
inline

Return the convex hull vertex at the specified index in this convex shape.

void om::physics::shapes::ConvexShape::addVertices ( const Vector3f *  newVertices,
UInt32  numVertices 
)

Add an array of new vertices to the convex shape and update the shape's convex hull.

void om::physics::shapes::ConvexShape::clearVertices ( )

Remove all vertices and triangles from this convex shape.

UInt32 om::physics::shapes::ConvexShape::getTriangleCount ( ) const
inline

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

const base::ConvexHull::Triangle& om::physics::shapes::ConvexShape::getTriangle ( UInt32  index) const
inline

Return the triangle at the specified index in this convex shape.

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

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

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

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

virtual void om::physics::shapes::ConvexShape::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::ConvexShape::getVolume ( ) const
virtual

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

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

SIMDFloat4 om::physics::shapes::ConvexShape::getSupportPoint ( const ConvexShape convex,
const SIMDFloat4 &  direction 
)
inlinestatic

Return the point on the specified convex that is farthest in the given normalized direction.

Member Data Documentation

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

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


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