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

A class that represents a rigid object within a physics simulation. More...

#include <omPhysicsRigidObject.h>

Inheritance diagram for om::physics::objects::RigidObject:
om::physics::objects::PhysicsObject om::physics::context::PhysicsSceneObject om::physics::context::PhysicsContextObject

Public Member Functions

 RigidObject ()
 Create a default physics object centered at the origin with no shape. More...
 
 RigidObject (PhysicsShape *newShape)
 Create a physics object with the specified shape centered at the origin. More...
 
UInt32 getShapeCount () const
 Return the number of shapes there are in this object. More...
 
PhysicsShapegetShape (UInt32 shapeIndex) const
 Return a pointer to the shape for this physics object at the specified index. More...
 
Bool setShape (UInt32 shapeIndex, PhysicsShape *newShape)
 Set a pointer to the shape for this physics object at the specified index. More...
 
CollidergetShapeCollider (UInt32 shapeIndex) const
 Return a pointer to the collider for the shape in this physics object at the specified index. More...
 
Bool addShape (PhysicsShape *newShape)
 Add a new shape to this object. More...
 
void clearShapes ()
 Remove all shapes from this object. More...
 
const Vector3f & getPosition () const
 Return the position of this physics object in world space. More...
 
void setPosition (const Vector3f &newPosition)
 Set the position of this physics object in world space. More...
 
const Matrix3f & getOrientation () const
 Return a reference to this object's 3x3 orthonormal rotation matrix. More...
 
void setOrientation (const Matrix3f &newOrientation)
 Set this object's 3x3 orthonormal rotation matrix. More...
 
const Transform3f & getTransform () const
 Return a const reference to this object's transformation. More...
 
void setTransform (const Transform3f &newTransform)
 Set this object's transformation. More...
 
const Vector3f & getScale () const
 Return the scale factor of this object. More...
 
void setScale (Float newScale)
 Set the scale facor of this object. More...
 
const Vector3f & getVelocity () const
 Return the linear velocity of this physics object in world units per second. More...
 
void setVelocity (const Vector3f &newVelocity)
 Set the linear velocity of this physics object in world units per second. More...
 
const Vector3f & getAngularVelocity () const
 Return the angular velocity of this physics object in radians per second. More...
 
void setAngularVelocity (const Vector3f &newAngularVelocity)
 Set the angular velocity of this physics object in radians per second. More...
 
const Vector3f & getVelocityMask () const
 Return the linear velocity mask of this physics object. More...
 
void setVelocityMask (const Vector3f &newVelocityMask)
 Set the linear velocity mask of this physics object. More...
 
const Vector3f & getAngularVelocityMask () const
 Return the angular velocity mask of this physics object. More...
 
void setAngularVelocityMask (const Vector3f &newAngularVelocityMask)
 Set the angular velocity mask of this physics object. More...
 
Float getMass () const
 Return the local-space mass of this object before scaling. More...
 
void setMass (Float newMass)
 Set the local-space mass of this object before scaling. More...
 
const Vector3f & getMassCenter () const
 Return the local-space center of mass of this object before scaling. More...
 
void setMassCenter (const Vector3f &newMassCenter)
 Set the local-space center of mass of this object before scaling. More...
 
const Matrix3f & getInertia () const
 Return the local-space inertia tensor of this object before scaling. More...
 
void setInertia (const Matrix3f &newInertia)
 Set the local-space inertia tensor of this object before scaling. More...
 
const ObjectFlagsgetFlags () const
 Return an object that contains boolean parameters of the object. More...
 
void setFlags (const ObjectFlags &newFlags)
 Set an object that contains boolean parameters of the object. More...
 
Bool flagIsSet (ObjectFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this object. More...
 
Bool flagsAreSet (const ObjectFlags &otherFlags) const
 Return whether or not all of the specified boolan flags are set for this object. More...
 
void setFlag (ObjectFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this object. More...
 
virtual Bool setContext (PhysicsContext *newContext)
 Set a pointer to the physics context this context object should use to do simulation. More...
 
ObjectStategetState () const
 Return a pointer to the the object's current context simulation object. More...
 
virtual Bool addSceneObjects (PhysicsSceneID sceneID)
 Add internal context objects to the scene with the specified ID. More...
 
virtual Bool upload ()
 Upload this object's current representation to the simulation. More...
 
virtual Bool download ()
 Download the object's simulation representation to the object's local state. More...
 
- Public Member Functions inherited from om::physics::objects::PhysicsObject
const PhysicsObjectTypegetType () const
 Return an object representing the type of this object. More...
 
- Public Member Functions inherited from om::physics::context::PhysicsSceneObject
virtual Bool addSceneObjects (PhysicsSceneID sceneID)
 Add internal context objects to the scene with the specified ID. More...
 
virtual Bool removeSceneObjects (PhysicsSceneID sceneID)
 Remove internal context objects from the scene with the specified ID. More...
 
- Public Member Functions inherited from om::physics::context::PhysicsContextObject
virtual ~PhysicsContextObject ()
 Destory this physics context object. More...
 
PhysicsContextgetContext () const
 Return a pointer to the physics context this context object is using to do simulation. More...
 
Bool clearContext ()
 Clear the previous context from this object. More...
 

Static Public Attributes

static const PhysicsObjectType TYPE
 The object type for a rigid object. More...
 
- Static Public Attributes inherited from om::physics::objects::PhysicsObject
static const ResourceType RESOURCE_TYPE
 The resource type for a physics object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::physics::objects::PhysicsObject
 PhysicsObject (const PhysicsObjectType *newType)
 Create a physics object that has the specified type. More...
 
- Protected Member Functions inherited from om::physics::context::PhysicsContextObject
 PhysicsContextObject ()
 Create a new physics context object that doesn't have an associated physics context. More...
 
 PhysicsContextObject (PhysicsContext *newContext)
 Create a new physics context object that uses the specified context for simulation. More...
 
- Protected Attributes inherited from om::physics::context::PhysicsContextObject
PhysicsContextcontext
 A pointer to the physics context this object is using. More...
 

Detailed Description

A class that represents a rigid object within a physics simulation.

A rigid object allows a collection of PhysicsShape objects to be simulated undergoing rigid transformations.

Constructor & Destructor Documentation

om::physics::objects::RigidObject::RigidObject ( )

Create a default physics object centered at the origin with no shape.

om::physics::objects::RigidObject::RigidObject ( PhysicsShape newShape)

Create a physics object with the specified shape centered at the origin.

Member Function Documentation

UInt32 om::physics::objects::RigidObject::getShapeCount ( ) const
inline

Return the number of shapes there are in this object.

PhysicsShape* om::physics::objects::RigidObject::getShape ( UInt32  shapeIndex) const
inline

Return a pointer to the shape for this physics object at the specified index.

Bool om::physics::objects::RigidObject::setShape ( UInt32  shapeIndex,
PhysicsShape newShape 
)

Set a pointer to the shape for this physics object at the specified index.

The method returns whether or not the operation was successful.

Collider* om::physics::objects::RigidObject::getShapeCollider ( UInt32  shapeIndex) const
inline

Return a pointer to the collider for the shape in this physics object at the specified index.

The collider pointer may be NULL if the physics object does not have a valid context.

Bool om::physics::objects::RigidObject::addShape ( PhysicsShape newShape)

Add a new shape to this object.

The method returns whether or not the shape was able to be added.

void om::physics::objects::RigidObject::clearShapes ( )

Remove all shapes from this object.

const Vector3f& om::physics::objects::RigidObject::getPosition ( ) const
inline

Return the position of this physics object in world space.

void om::physics::objects::RigidObject::setPosition ( const Vector3f &  newPosition)
inline

Set the position of this physics object in world space.

const Matrix3f& om::physics::objects::RigidObject::getOrientation ( ) const
inline

Return a reference to this object's 3x3 orthonormal rotation matrix.

void om::physics::objects::RigidObject::setOrientation ( const Matrix3f &  newOrientation)

Set this object's 3x3 orthonormal rotation matrix.

const Transform3f& om::physics::objects::RigidObject::getTransform ( ) const
inline

Return a const reference to this object's transformation.

This indicates the rigid transformation for this object, allowing translation, rotation, and uniform scaling.

void om::physics::objects::RigidObject::setTransform ( const Transform3f &  newTransform)

Set this object's transformation.

This indicates the rigid transformation for this object, allowing translation, rotation, and uniform scaling.

const Vector3f& om::physics::objects::RigidObject::getScale ( ) const
inline

Return the scale factor of this object.

void om::physics::objects::RigidObject::setScale ( Float  newScale)
inline

Set the scale facor of this object.

const Vector3f& om::physics::objects::RigidObject::getVelocity ( ) const
inline

Return the linear velocity of this physics object in world units per second.

void om::physics::objects::RigidObject::setVelocity ( const Vector3f &  newVelocity)
inline

Set the linear velocity of this physics object in world units per second.

const Vector3f& om::physics::objects::RigidObject::getAngularVelocity ( ) const
inline

Return the angular velocity of this physics object in radians per second.

void om::physics::objects::RigidObject::setAngularVelocity ( const Vector3f &  newAngularVelocity)
inline

Set the angular velocity of this physics object in radians per second.

const Vector3f& om::physics::objects::RigidObject::getVelocityMask ( ) const
inline

Return the linear velocity mask of this physics object.

The velocity mask indicates the extent that the object is able to translate along the 3 world axis. A value of (1,1,1) is the default, indicating full motion. The motion can be restricted by setting mask components to 0.

void om::physics::objects::RigidObject::setVelocityMask ( const Vector3f &  newVelocityMask)
inline

Set the linear velocity mask of this physics object.

The velocity mask indicates the extent that the object is able to translate along the 3 world axis. A value of (1,1,1) is the default, indicating full motion. The motion can be restricted by setting mask components to 0.

const Vector3f& om::physics::objects::RigidObject::getAngularVelocityMask ( ) const
inline

Return the angular velocity mask of this physics object.

The angular velocity mask indicates the extent that the object is able to rotate around the 3 local axis. A value of (1,1,1) is the default, indicating full rotation. The rotation can be restricted by setting mask components to 0.

void om::physics::objects::RigidObject::setAngularVelocityMask ( const Vector3f &  newAngularVelocityMask)
inline

Set the angular velocity mask of this physics object.

The angular velocity mask indicates the extent that the object is able to rotate around the 3 local axis. A value of (1,1,1) is the default, indicating full rotation. The rotation can be restricted by setting mask components to 0.

Float om::physics::objects::RigidObject::getMass ( ) const
inline

Return the local-space mass of this object before scaling.

void om::physics::objects::RigidObject::setMass ( Float  newMass)
inline

Set the local-space mass of this object before scaling.

const Vector3f& om::physics::objects::RigidObject::getMassCenter ( ) const
inline

Return the local-space center of mass of this object before scaling.

void om::physics::objects::RigidObject::setMassCenter ( const Vector3f &  newMassCenter)
inline

Set the local-space center of mass of this object before scaling.

const Matrix3f& om::physics::objects::RigidObject::getInertia ( ) const
inline

Return the local-space inertia tensor of this object before scaling.

void om::physics::objects::RigidObject::setInertia ( const Matrix3f &  newInertia)
inline

Set the local-space inertia tensor of this object before scaling.

const ObjectFlags& om::physics::objects::RigidObject::getFlags ( ) const
inline

Return an object that contains boolean parameters of the object.

void om::physics::objects::RigidObject::setFlags ( const ObjectFlags newFlags)
inline

Set an object that contains boolean parameters of the object.

Bool om::physics::objects::RigidObject::flagIsSet ( ObjectFlags::Flag  flag) const
inline

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

Bool om::physics::objects::RigidObject::flagsAreSet ( const ObjectFlags otherFlags) const
inline

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

void om::physics::objects::RigidObject::setFlag ( ObjectFlags::Flag  flag,
Bool  newIsSet = true 
)
inline

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

virtual Bool om::physics::objects::RigidObject::setContext ( PhysicsContext newContext)
virtual

Set a pointer to the physics context this context object should use to do simulation.

Reimplemented from om::physics::context::PhysicsContextObject.

ObjectState* om::physics::objects::RigidObject::getState ( ) const
inline

Return a pointer to the the object's current context simulation object.

virtual Bool om::physics::objects::RigidObject::addSceneObjects ( PhysicsSceneID  sceneID)
virtual

Add internal context objects to the scene with the specified ID.

virtual Bool om::physics::objects::RigidObject::upload ( )
virtual

Upload this object's current representation to the simulation.

This method should be called if the local object state is modified and those changes should be reflected in the global simulation.

The object's state is automatically uploaded when it is first created in a simulation context.

The method returns whether or not the state was uploaded.

Reimplemented from om::physics::objects::PhysicsObject.

virtual Bool om::physics::objects::RigidObject::download ( )
virtual

Download the object's simulation representation to the object's local state.

This method should be called if the current simulation state is needed after the simulation state was previously updated.

The method returns whether or not the state was downloaded.

Reimplemented from om::physics::objects::PhysicsObject.

Member Data Documentation

const PhysicsObjectType om::physics::objects::RigidObject::TYPE
static

The object type for a rigid object.


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