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

An interface for classes that handle all aspects of physics simulation. More...

#include <omPhysicsScene.h>

Inheritance diagram for om::physics::objects::PhysicsScene:
om::physics::context::PhysicsContextObject

Public Member Functions

 PhysicsScene ()
 Create a new empty physics scene. More...
 
 ~PhysicsScene ()
 Destroy this physics scene. More...
 
Size getObjectCount () const
 Return the number of physics objects that are contained in this scene. More...
 
PhysicsObjectgetObject (Index objectIndex) const
 Return a pointer to the object at the specified index in this scene. More...
 
Bool setObject (Index objectIndex, PhysicsObject *newObject)
 Set a pointer to the object at the specified index in this scene. More...
 
Bool addObject (PhysicsObject *object)
 Add the specified physics object to this scene. More...
 
Bool removeObject (PhysicsObject *object)
 Remove the specified physics object from this scene. More...
 
void clearObjects ()
 Remove all physics objects from this scene. More...
 
Size getConstraintCount () const
 Return the number of constraints that are contained in this scene. More...
 
ConstraintgetConstraint (Index constraintIndex) const
 Return a pointer to the constraint at the specified index in this scene. More...
 
Bool setConstraint (Index constraintIndex, Constraint *newConstraint)
 Set a pointer to the constraint at the specified index in this scene. More...
 
Bool addConstraint (Constraint *constraint)
 Add the specified constraint to this scene. More...
 
Bool removeConstraint (Constraint *constraint)
 Remove the specified constraint from this scene. More...
 
void clearConstraints ()
 Remove all constraints from this scene. More...
 
Size getForceCount () const
 Return the number of forces that are contained in this scene. More...
 
ForcegetForce (Index forceIndex) const
 Return a pointer to the force at the specified index in this scene. More...
 
Bool setForce (Index forceIndex, Force *newForce)
 Set a pointer to the force at the specified index in this scene. More...
 
Bool addForce (Force *force)
 Add the specified force to this scene. More...
 
Bool removeForce (Force *force)
 Remove the specified force from this scene. More...
 
void clearForces ()
 Remove all forces from this scene. More...
 
Size getFieldCount () const
 Return the number of force fields that are contained in this scene. More...
 
ForceFieldgetField (Index fieldIndex) const
 Return a pointer to the force field at the specified index in this scene. More...
 
Bool setField (Index fieldIndex, ForceField *newField)
 Set a pointer to the force field at the specified index in this scene. More...
 
Bool addField (ForceField *field)
 Add the specified force field to this scene. More...
 
Bool removeField (ForceField *field)
 Remove the specified force field from this scene. More...
 
void clearFields ()
 Remove all force fields from this scene. More...
 
virtual Bool setContext (PhysicsContext *newContext)
 Set a pointer to the physics context this context object should use to do simulation. More...
 
PhysicsSceneID getID () const
 Return the ID of this physics scene within its current physics context. 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...
 

Public Attributes

ArrayList< PhysicsObject * > objects
 A list of the objects that are part of this physics scene. More...
 
ArrayList< Constraint * > constraints
 A list of the constraints that are part of this physics scene. More...
 
ArrayList< Force * > forces
 A list of the forces that are part of this physics scene. More...
 
ArrayList< ForceField * > fields
 A list of the force fields that are part of this physics scene. More...
 
PhysicsSceneID sceneID
 The internal ID of this scene within its context. More...
 

Static Public Attributes

static const ResourceType RESOURCE_TYPE
 The resource type for a physics scene. More...
 

Additional Inherited Members

- 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

An interface for classes that handle all aspects of physics simulation.

Constructor & Destructor Documentation

om::physics::objects::PhysicsScene::PhysicsScene ( )

Create a new empty physics scene.

om::physics::objects::PhysicsScene::~PhysicsScene ( )

Destroy this physics scene.

Member Function Documentation

Size om::physics::objects::PhysicsScene::getObjectCount ( ) const
inline

Return the number of physics objects that are contained in this scene.

PhysicsObject* om::physics::objects::PhysicsScene::getObject ( Index  objectIndex) const
inline

Return a pointer to the object at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::setObject ( Index  objectIndex,
PhysicsObject newObject 
)
inline

Set a pointer to the object at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::addObject ( PhysicsObject object)

Add the specified physics object to this scene.

If the specified physics object pointer is NULL, the object is not added.

Bool om::physics::objects::PhysicsScene::removeObject ( PhysicsObject object)

Remove the specified physics object from this scene.

If this scene contains the specified physics object, the object is removed from the physics scene and TRUE is returned. Otherwise, if the physics object is not found, FALSE is returned and the physics scene is unchanged.

void om::physics::objects::PhysicsScene::clearObjects ( )

Remove all physics objects from this scene.

Size om::physics::objects::PhysicsScene::getConstraintCount ( ) const
inline

Return the number of constraints that are contained in this scene.

Constraint* om::physics::objects::PhysicsScene::getConstraint ( Index  constraintIndex) const
inline

Return a pointer to the constraint at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::setConstraint ( Index  constraintIndex,
Constraint newConstraint 
)
inline

Set a pointer to the constraint at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::addConstraint ( Constraint constraint)

Add the specified constraint to this scene.

If the specified constraint pointer is NULL, the object is not added.

Bool om::physics::objects::PhysicsScene::removeConstraint ( Constraint constraint)

Remove the specified constraint from this scene.

If this scene contains the specified constraint, the constraint is removed from the physics scene and TRUE is returned. Otherwise, if the constraint is not found, FALSE is returned and the physics scene is unchanged.

void om::physics::objects::PhysicsScene::clearConstraints ( )

Remove all constraints from this scene.

Size om::physics::objects::PhysicsScene::getForceCount ( ) const
inline

Return the number of forces that are contained in this scene.

Force* om::physics::objects::PhysicsScene::getForce ( Index  forceIndex) const
inline

Return a pointer to the force at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::setForce ( Index  forceIndex,
Force newForce 
)
inline

Set a pointer to the force at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::addForce ( Force force)

Add the specified force to this scene.

If the specified force pointer is NULL, the object is not added.

Bool om::physics::objects::PhysicsScene::removeForce ( Force force)

Remove the specified force from this scene.

If this scene contains the specified force, the force is removed from the physics scene and TRUE is returned. Otherwise, if the force is not found, FALSE is returned and the physics scene is unchanged.

void om::physics::objects::PhysicsScene::clearForces ( )

Remove all forces from this scene.

Size om::physics::objects::PhysicsScene::getFieldCount ( ) const
inline

Return the number of force fields that are contained in this scene.

ForceField* om::physics::objects::PhysicsScene::getField ( Index  fieldIndex) const
inline

Return a pointer to the force field at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::setField ( Index  fieldIndex,
ForceField newField 
)
inline

Set a pointer to the force field at the specified index in this scene.

Bool om::physics::objects::PhysicsScene::addField ( ForceField field)

Add the specified force field to this scene.

If the specified force field pointer is not equal to NULL, it is added to this physics scene. Otherwise, the physics scene is unchanged.

Bool om::physics::objects::PhysicsScene::removeField ( ForceField field)

Remove the specified force field from this scene.

If this scene contains the specified force field, the field is removed from the physics scene and TRUE is returned. Otherwise, if the force field is not found, FALSE is returned and the physics scene is unchanged.

void om::physics::objects::PhysicsScene::clearFields ( )

Remove all force fields from this scene.

virtual Bool om::physics::objects::PhysicsScene::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.

PhysicsSceneID om::physics::objects::PhysicsScene::getID ( ) const
inline

Return the ID of this physics scene within its current physics context.

Member Data Documentation

const ResourceType om::physics::objects::PhysicsScene::RESOURCE_TYPE
static

The resource type for a physics scene.

ArrayList<PhysicsObject*> om::physics::objects::PhysicsScene::objects

A list of the objects that are part of this physics scene.

ArrayList<Constraint*> om::physics::objects::PhysicsScene::constraints

A list of the constraints that are part of this physics scene.

ArrayList<Force*> om::physics::objects::PhysicsScene::forces

A list of the forces that are part of this physics scene.

ArrayList<ForceField*> om::physics::objects::PhysicsScene::fields

A list of the force fields that are part of this physics scene.

PhysicsSceneID om::physics::objects::PhysicsScene::sceneID

The internal ID of this scene within its context.


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