Om
1.0.0
A universal framework for multimedia simulation
|
An interface for classes that handle all aspects of physics simulation. More...
#include <omPhysicsScene.h>
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... | |
PhysicsObject * | getObject (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... | |
Constraint * | getConstraint (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... | |
Force * | getForce (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... | |
ForceField * | getField (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... | |
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... | |
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 | |
PhysicsContext * | context |
A pointer to the physics context this object is using. More... | |
An interface for classes that handle all aspects of physics simulation.
om::physics::objects::PhysicsScene::PhysicsScene | ( | ) |
Create a new empty physics scene.
om::physics::objects::PhysicsScene::~PhysicsScene | ( | ) |
Destroy this physics scene.
|
inline |
Return the number of physics objects that are contained in this scene.
|
inline |
Return a pointer to the object at the specified index in this scene.
|
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.
|
inline |
Return the number of constraints that are contained in this scene.
|
inline |
Return a pointer to the constraint at the specified index in this scene.
|
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.
|
inline |
Return the number of forces that are contained in this scene.
Return a pointer to the force at the specified index in this scene.
Set a pointer to the force at the specified index in this scene.
Add the specified force to this scene.
If the specified force pointer is NULL, the object is not added.
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.
|
inline |
Return the number of force fields that are contained in this scene.
|
inline |
Return a pointer to the force field at the specified index in this scene.
|
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 |
Set a pointer to the physics context this context object should use to do simulation.
Reimplemented from om::physics::context::PhysicsContextObject.
|
inline |
Return the ID of this physics scene within its current physics context.
|
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.
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.