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

A class that represents an abstract 3D geometry within a physics simulation. More...

#include <omPhysicsShape.h>

Inheritance diagram for om::physics::shapes::PhysicsShape:
om::physics::shapes::BoxShape om::physics::shapes::CapsuleShape om::physics::shapes::ConvexShape om::physics::shapes::CylinderShape om::physics::shapes::MeshShape om::physics::shapes::SphereShape

Public Member Functions

virtual ~PhysicsShape ()
 Destroy this physics shape and all resources it has. More...
 
virtual void getMassInfo (Float &mass, Vector3f &massCenter, Matrix3f &inertia) const =0
 Get the mass distribution for this shape in its local space in the output parameters. More...
 
virtual Float getVolume () const =0
 Return the volume of this shape in distance units cubed (m^3) in its coordinate frame. 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 ResourceType RESOURCE_TYPE
 The resource type for a physics shape. More...
 

Protected Member Functions

 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 an abstract 3D geometry within a physics simulation.

Constructor & Destructor Documentation

virtual om::physics::shapes::PhysicsShape::~PhysicsShape ( )
virtual

Destroy this physics shape and all resources it has.

om::physics::shapes::PhysicsShape::PhysicsShape ( const ShapeType newType)
inlineprotected

Create a PhysicsShape object that has the specified subtype.

Member Function Documentation

virtual void om::physics::shapes::PhysicsShape::getMassInfo ( Float mass,
Vector3f &  massCenter,
Matrix3f &  inertia 
) const
pure virtual
virtual Float om::physics::shapes::PhysicsShape::getVolume ( ) const
pure virtual
const AABB3f& om::physics::shapes::PhysicsShape::getBoundingBox ( ) const
inline

Return a const reference to the local bounding box of this shape in its coordinate frame.

ShapeFlags& om::physics::shapes::PhysicsShape::getFlags ( )
inline

Return a reference to an object that contains boolean parameters of the shape.

const ShapeFlags& om::physics::shapes::PhysicsShape::getFlags ( ) const
inline

Return an object that contains boolean parameters of the shape.

void om::physics::shapes::PhysicsShape::setFlags ( const ShapeFlags newFlags)
inline

Set an object that contains boolean parameters of the shape.

Bool om::physics::shapes::PhysicsShape::flagIsSet ( ShapeFlags::Flag  flag) const
inline

Return whether or not the specified boolan flag is set for this shape.

Bool om::physics::shapes::PhysicsShape::flagsAreSet ( const ShapeFlags otherFlags) const
inline

Return whether or not all of the specified boolan flags are set for this shape.

void om::physics::shapes::PhysicsShape::setFlag ( ShapeFlags::Flag  flag,
Bool  newIsSet = true 
)
inline

Set whether or not the specified boolan flag is set for this shape.

ShapeTypeID om::physics::shapes::PhysicsShape::getTypeID ( ) const
inline

Return an integer identifying the type of this collision shape.

const ShapeType& om::physics::shapes::PhysicsShape::getType ( ) const
inline

Return an object representing the type of this PhysicsShape.

void om::physics::shapes::PhysicsShape::setBoundingBox ( const AABB3f &  newBoundingBox)
inlineprotected

Set the local-space bounding box to use for this PhysicsShape.

This method should be called by a subclass of the PhysicsShape class in order to assure that the shape has the proper bounding box. If this attribute is not properly set, collision detection will not work properly.

Member Data Documentation

const ResourceType om::physics::shapes::PhysicsShape::RESOURCE_TYPE
static

The resource type for a physics shape.


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