Om
1.0.0
A universal framework for multimedia simulation
|
A class that applies gravitational forces to objects in a physics simulation. More...
#include <omPhysicsGravityField.h>
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 | |
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... | |
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 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 | |
PhysicsContext * | context |
A pointer to the physics context this object is using. More... | |
A class that applies gravitational forces to objects in a physics simulation.
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.
|
inline |
Return the uniform gravitational acceleration vector of this gravity field.
|
inline |
Set the uniform gravitational acceleration vector of this gravity field.
|
virtual |
Apply gravitiational force vectors to all objects that this gravity field effects.
Implements om::physics::forces::Force.
|
virtual |
Return the number of physics objects that are contained in this gravity field.
Implements om::physics::forces::ForceField.
|
virtual |
Add the specified physics object to this gravity field.
Implements om::physics::forces::ForceField.
|
virtual |
Remove the specified physics object from this gravity field.
Implements om::physics::forces::ForceField.
|
virtual |
Remove all physics objects from this GravityField.
Implements om::physics::forces::ForceField.
|
static |
A force type object that represents the type of a gravity field.