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

A class that applies gravitational forces to objects in a physics simulation. More...

#include <omPhysicsGravityField.h>

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

Public Member Functions

 GravityField ()
 Create a new empty gravity field with a uniform acceleration of 9.81 m/s^2 in the negative-Y direction. More...
 
 GravityField (const Vector3f &uniformGravity)
 Create a new empty gravity field with the specified uniform acceleration vector. More...
 
const Vector3f & getGravity () const
 Return the uniform gravitational acceleration vector of this gravity field. More...
 
void setGravity (const Vector3f &newGravity)
 Set the uniform gravitational acceleration vector of this gravity field. More...
 
virtual void applyForce (Float dt)
 Apply gravitiational force vectors to all objects that this gravity field effects. More...
 
virtual Size getObjectCount () const
 Return the number of physics objects that are contained in this gravity field. More...
 
virtual void addObject (ObjectState *object)
 Add the specified physics object to this gravity field. More...
 
virtual Bool removeObject (const ObjectState *object)
 Remove the specified physics object from this gravity field. More...
 
virtual void clearObjects ()
 Remove all physics objects from this GravityField. More...
 
- Public Member Functions inherited from om::physics::forces::ForceField
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...
 
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 ForceType TYPE
 A force type object that represents the type of a gravity field. More...
 
- Static Public Attributes inherited from om::physics::forces::ForceField
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...
 

Additional Inherited Members

- Protected Member Functions inherited from om::physics::forces::ForceField
 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 inherited from om::physics::forces::ForceField
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

A class that applies gravitational forces to objects in a physics simulation.

Constructor & Destructor Documentation

om::physics::forces::GravityField::GravityField ( )

Create a new empty gravity field with a uniform acceleration of 9.81 m/s^2 in the negative-Y direction.

om::physics::forces::GravityField::GravityField ( const Vector3f &  uniformGravity)

Create a new empty gravity field with the specified uniform acceleration vector.

Member Function Documentation

const Vector3f& om::physics::forces::GravityField::getGravity ( ) const
inline

Return the uniform gravitational acceleration vector of this gravity field.

void om::physics::forces::GravityField::setGravity ( const Vector3f &  newGravity)
inline

Set the uniform gravitational acceleration vector of this gravity field.

virtual void om::physics::forces::GravityField::applyForce ( Float  dt)
virtual

Apply gravitiational force vectors to all objects that this gravity field effects.

Implements om::physics::forces::Force.

virtual Size om::physics::forces::GravityField::getObjectCount ( ) const
virtual

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

Implements om::physics::forces::ForceField.

virtual void om::physics::forces::GravityField::addObject ( ObjectState object)
virtual

Add the specified physics object to this gravity field.

Implements om::physics::forces::ForceField.

virtual Bool om::physics::forces::GravityField::removeObject ( const ObjectState object)
virtual

Remove the specified physics object from this gravity field.

Implements om::physics::forces::ForceField.

virtual void om::physics::forces::GravityField::clearObjects ( )
virtual

Remove all physics objects from this GravityField.

Implements om::physics::forces::ForceField.

Member Data Documentation

const ForceType om::physics::forces::GravityField::TYPE
static

A force type object that represents the type of a gravity field.


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