PhysicsEngine Class Reference
[Engines]
#include <PhysicsEngine.hh>
Inheritance diagram for PhysicsEngine:
Detailed Description
Base class for a physics engine.The parameters are as follows:
- speed (float)
- Target simulation speed (e.g. speed 2 yields twice real time).
- Default 1.0
- gravity (float vector)
- The gravity vector (m/sec/sec); the default corresponds to Earth gravity.
- Default 0 0 -9.8
- stepTime (float)
- The minimum step time for the simulator. Reducing the step time will increase the fidelity of the physical simulation, but consume more CPU time. If you have particulary complex system that appears to be diverging (i.e., objects "explode" when they come into collision), consider reducing the step time.
- Default 0.020
Public Member Functions | |
PhysicsEngine () | |
Default constructor. | |
virtual | ~PhysicsEngine () |
Destructor. | |
virtual void | Load (XMLConfigNode *node)=0 |
Load the physics engine. | |
virtual void | Save (XMLConfigNode *node)=0 |
Saves to XMLFile. | |
virtual void | Init ()=0 |
Initialize the physics engine. | |
virtual void | Update ()=0 |
Update the physics engine. | |
virtual void | Fini ()=0 |
Finilize the physics engine. | |
virtual void | AddEntity (Entity *entity)=0 |
Add an entity. | |
virtual void | RemoveEntity (Entity *entity)=0 |
Remove an entity from the physics engine. | |
virtual Body * | CreateBody (Entity *parent)=0 |
Create a new body. | |
virtual Joint * | CreateJoint (Joint::Type type)=0 |
Create a new joint. | |
Vector3 | GetGravity () const |
Return the gavity vector. | |
double | GetStepTime () const |
Get the time between each update cycle. | |
Protected Attributes | |
Vector3 | gravity |
The gravity vector. | |
double | stepTime |
Time between each update cycle. |
Member Function Documentation
virtual void Load | ( | XMLConfigNode * | node | ) | [pure virtual] |
virtual void Save | ( | XMLConfigNode * | node | ) | [pure virtual] |
Vector3 GetGravity | ( | ) | const |
Return the gavity vector.
- Returns:
- The gavity vector
double GetStepTime | ( | ) | const |
The documentation for this class was generated from the following file: