Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
om::physics::forces::ForceField Class Referenceabstract

An extension of the Force interface which can apply forces to a collection of objects. More...

#include <omPhysicsForceField.h>

Inheritance diagram for om::physics::forces::ForceField:
om::physics::forces::Force om::physics::context::PhysicsSceneObject om::physics::context::PhysicsContextObject om::physics::forces::GravityField

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...
 
ForceFieldFlagsgetFlags ()
 Return a reference to an object that contains boolean parameters of the force field. More...
 
const ForceFieldFlagsgetFlags () 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 ForceTypegetType () 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...
 
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 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
PhysicsContextcontext
 A pointer to the physics context this object is using. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

om::physics::forces::ForceField::ForceField ( const ForceType forceType)
protected

Create a new force field with the default initial state.

Member Function Documentation

virtual Size om::physics::forces::ForceField::getObjectCount ( ) const
pure virtual

Return the number of objects that are contained in this ForceField.

Implemented in om::physics::forces::GravityField.

virtual void om::physics::forces::ForceField::addObject ( ObjectState object)
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.

virtual Bool om::physics::forces::ForceField::removeObject ( const ObjectState object)
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.

virtual void om::physics::forces::ForceField::clearObjects ( )
pure virtual

Remove all physics objects from this ForceField.

Implemented in om::physics::forces::GravityField.

ForceFieldFlags& om::physics::forces::ForceField::getFlags ( )
inline

Return a reference to an object that contains boolean parameters of the force field.

const ForceFieldFlags& om::physics::forces::ForceField::getFlags ( ) const
inline

Return an object that contains boolean parameters of the force field.

void om::physics::forces::ForceField::setFlags ( const ForceFieldFlags newFlags)
inline

Set an object that contains boolean parameters of the force field.

Bool om::physics::forces::ForceField::flagIsSet ( ForceFieldFlags::Flag  flag) const
inline

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

Bool om::physics::forces::ForceField::flagsAreSet ( const ForceFieldFlags otherFlags) const
inline

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

void om::physics::forces::ForceField::setFlag ( ForceFieldFlags::Flag  flag,
Bool  newIsSet = true 
)
inline

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

virtual Bool om::physics::forces::ForceField::setContext ( PhysicsContext newContext)
virtual

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

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

virtual Bool om::physics::forces::ForceField::addSceneObjects ( PhysicsSceneID  sceneID)
virtual

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

Member Data Documentation

const ResourceType om::physics::forces::ForceField::RESOURCE_TYPE
static

The resource type for a force field.

ForceFieldFlags om::physics::forces::ForceField::flags
protected

An object that contains boolean configuration flags for this force field.

ForceFieldID om::physics::forces::ForceField::fieldID
protected

The ID of this force field within its context.


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