PhysicsEngine Class Reference
[Engines]
#include <PhysicsEngine.hh>
Inheritance diagram for PhysicsEngine:
Detailed Description
<physics:<engine_type>> <gravity>0.0 0.0 -9.8 </gravity> <stepTime>0.020</stepTime> </physics:<engine_type>>
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.020Base class for a physics engine
Public Member Functions | |
PhysicsEngine () | |
virtual | ~PhysicsEngine () |
virtual void | Load (XMLConfigNode *node)=0 |
virtual void | Init ()=0 |
virtual void | Update ()=0 |
virtual void | Fini ()=0 |
virtual void | AddEntity (Entity *entity)=0 |
virtual void | RemoveEntity (Entity *entity)=0 |
virtual Body * | CreateBody (Entity *parent)=0 |
virtual Joint * | CreateJoint (Joint::Type type)=0 |
Vector3 | GetGravity () const |
double | GetStepTime () const |
Protected Attributes | |
Vector3 | gravity |
The gravity vector. | |
double | stepTime |
Time between each update cycle. |
Constructor & Destructor Documentation
PhysicsEngine | ( | ) |
Default constructor
virtual ~PhysicsEngine | ( | ) | [virtual] |
Destructor
Member Function Documentation
virtual void Load | ( | XMLConfigNode * | node | ) | [pure virtual] |
virtual void Init | ( | ) | [pure virtual] |
Initialize the physics engine
Implemented in ODEPhysics.
virtual void Update | ( | ) | [pure virtual] |
Update the physics engine
Implemented in ODEPhysics.
virtual void Fini | ( | ) | [pure virtual] |
Finilize the physics engine
Implemented in ODEPhysics.
virtual void AddEntity | ( | Entity * | entity | ) | [pure virtual] |
Add an entity
Implemented in ODEPhysics.
virtual void RemoveEntity | ( | Entity * | entity | ) | [pure virtual] |
Remove an entity from the physics engine
Implemented in ODEPhysics.
Create a new body
Implemented in ODEPhysics.
virtual Joint* CreateJoint | ( | Joint::Type | type | ) | [pure virtual] |
Create a new joint
Implemented in ODEPhysics.
Vector3 GetGravity | ( | ) | const |
Return the gavity vector
- Returns:
- The gavity vector
double GetStepTime | ( | ) | const |
Get the time between each update cycle
- Returns:
- Time in seconds
The documentation for this class was generated from the following file: