Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a rigid object within a physics simulation. More...
#include <omPhysicsRigidObject.h>
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... | |
PhysicsShape * | getShape (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... | |
Collider * | getShapeCollider (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 ObjectFlags & | getFlags () 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... | |
ObjectState * | getState () 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 PhysicsObjectType & | getType () 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... | |
PhysicsContext * | getContext () 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 | |
PhysicsContext * | context |
A pointer to the physics context this object is using. More... | |
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.
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.
|
inline |
Return the number of shapes there are in this object.
|
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.
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.
|
inline |
Return the position of this physics object in world space.
|
inline |
Set the position of this physics object in world space.
|
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.
|
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.
|
inline |
Return the scale factor of this object.
|
inline |
Set the scale facor of this object.
|
inline |
Return the linear velocity of this physics object in world units per second.
|
inline |
Set the linear velocity of this physics object in world units per second.
|
inline |
Return the angular velocity of this physics object in radians per second.
|
inline |
Set the angular velocity of this physics object in radians per second.
|
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.
|
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.
|
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.
|
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.
|
inline |
Return the local-space mass of this object before scaling.
|
inline |
Set the local-space mass of this object before scaling.
|
inline |
Return the local-space center of mass of this object before scaling.
|
inline |
Set the local-space center of mass of this object before scaling.
|
inline |
Return the local-space inertia tensor of this object before scaling.
|
inline |
Set the local-space inertia tensor of this object before scaling.
|
inline |
Return an object that contains boolean parameters of the object.
|
inline |
Set an object that contains boolean parameters of the object.
|
inline |
Return whether or not the specified boolan flag is set for this object.
|
inline |
Return whether or not all of the specified boolan flags are set for this object.
|
inline |
Set whether or not the specified boolan flag is set for this object.
|
virtual |
Set a pointer to the physics context this context object should use to do simulation.
Reimplemented from om::physics::context::PhysicsContextObject.
|
inline |
Return a pointer to the the object's current context simulation object.
|
virtual |
Add internal context objects to the scene with the specified ID.
|
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 |
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.
|
static |
The object type for a rigid object.