Om
1.0.0
A universal framework for multimedia simulation
|
An extension of the Force interface which can apply forces to a collection of objects. More...
#include <omPhysicsForceField.h>
Public Member Functions | |
virtual Size | getObjectCount () const =0 |
Return the number of objects that are contained in this ForceField. More... | |
virtual void | addObject (ObjectState *object)=0 |
Add the specified object to this ForceField. More... | |
virtual Bool | removeObject (const ObjectState *object)=0 |
Remove the specified object from this ForceField. More... | |
virtual void | clearObjects ()=0 |
Remove all physics objects from this ForceField. More... | |
ForceFieldFlags & | getFlags () |
Return a reference to an object that contains boolean parameters of the force field. More... | |
const ForceFieldFlags & | getFlags () const |
Return an object that contains boolean parameters of the force field. More... | |
void | setFlags (const ForceFieldFlags &newFlags) |
Set an object that contains boolean parameters of the force field. More... | |
Bool | flagIsSet (ForceFieldFlags::Flag flag) const |
Return whether or not the specified boolan flag is set for this force field. More... | |
Bool | flagsAreSet (const ForceFieldFlags &otherFlags) const |
Return whether or not all of the specified boolan flags are set for this force field. More... | |
void | setFlag (ForceFieldFlags::Flag flag, Bool newIsSet=true) |
Set whether or not the specified boolan flag is set for this force field. More... | |
virtual Bool | setContext (PhysicsContext *newContext) |
Set a pointer to the physics context this force field should use to do simulation. More... | |
virtual Bool | addSceneObjects (PhysicsSceneID sceneID) |
Add internal context objects to the scene with the specified ID. More... | |
Public Member Functions inherited from om::physics::forces::Force | |
virtual | ~Force () |
Destory this force object. More... | |
virtual void | applyForce (Float dt)=0 |
Apply force vectors to all objects that this Force effects. More... | |
const ForceType & | getType () const |
Return an object representing the type of this Force. 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 ResourceType | RESOURCE_TYPE |
The resource type for a force field. More... | |
Static Public Attributes inherited from om::physics::forces::Force | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a force. More... | |
Protected Member Functions | |
ForceField (const ForceType *forceType) | |
Create a new force field with the default initial state. More... | |
Protected Member Functions inherited from om::physics::forces::Force | |
Force (const ForceType *newType) | |
Create a Force 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 | |
ForceFieldFlags | flags |
An object that contains boolean configuration flags for this force field. More... | |
ForceFieldID | fieldID |
The ID of this force field within its context. More... | |
Protected Attributes inherited from om::physics::context::PhysicsContextObject | |
PhysicsContext * | context |
A pointer to the physics context this object is using. More... | |
An extension of the Force interface which can apply forces to a collection of objects.
By deriving from this class, one can simulate various global or n-body force fields such as gravity, magnetism, etc.
|
protected |
Create a new force field with the default initial state.
|
pure virtual |
Return the number of objects that are contained in this ForceField.
Implemented in om::physics::forces::GravityField.
|
pure virtual |
Add the specified object to this ForceField.
If the specified object pointer is NULL, the force field is unchanged.
Implemented in om::physics::forces::GravityField.
|
pure virtual |
Remove the specified object from this ForceField.
If this ForceField contains the specified object, the object is removed from the force system and TRUE is returned. Otherwise, if the object is not found, FALSE is returned and the force field is unchanged.
Implemented in om::physics::forces::GravityField.
|
pure virtual |
Remove all physics objects from this ForceField.
Implemented in om::physics::forces::GravityField.
|
inline |
Return a reference to an object that contains boolean parameters of the force field.
|
inline |
Return an object that contains boolean parameters of the force field.
|
inline |
Set an object that contains boolean parameters of the force field.
|
inline |
Return whether or not the specified boolan flag is set for this force field.
|
inline |
Return whether or not all of the specified boolan flags are set for this force field.
|
inline |
Set whether or not the specified boolan flag is set for this force field.
|
virtual |
Set a pointer to the physics context this force field should use to do simulation.
Reimplemented from om::physics::context::PhysicsContextObject.
|
virtual |
Add internal context objects to the scene with the specified ID.
|
static |
The resource type for a force field.
|
protected |
An object that contains boolean configuration flags for this force field.
|
protected |
The ID of this force field within its context.