Klamp't
0.8.1
|
An interface to the ODE simulator. More...
#include <ODESimulator.h>
Public Types | |
enum | Status { StatusNormal =0, StatusAdaptiveTimeStepping =1, StatusContactUnreliable =2, StatusUnstable =3, StatusError =4 } |
Public Member Functions | |
void | SetGravity (const Vector3 &g) |
void | SetERP (double erp) |
void | SetCFM (double erp) |
ODESimulatorSettings & | GetSettings () |
Status | GetStatus () const |
void | GetStatusHistory (vector< Status > &statuses, vector< Real > &statusChangeTimes) const |
void | AddTerrain (Terrain &terr) |
void | AddRobot (Robot &robot) |
void | AddObject (RigidObject &object) |
bool | CheckObjectOverlap (vector< pair< ODEObjectID, ODEObjectID > > &overlaps) |
void | Step (Real dt) |
void | StepDynamics (Real dt) |
bool | ReadState (File &f) |
bool | WriteState (File &f) const |
size_t | numTerrains () const |
size_t | numRobots () const |
size_t | numObjects () const |
dWorldID | world () const |
const Terrain * | terrain (int i) const |
ODEGeometry * | terrainGeom (int i) const |
ODERobot * | robot (int i) const |
ODERigidObject * | object (int i) const |
string | ObjectName (const ODEObjectID &obj) const |
dBodyID | ObjectBody (const ODEObjectID &obj) const |
dGeomID | ObjectGeom (const ODEObjectID &obj) const |
void | EnableContactFeedback (const ODEObjectID &a, const ODEObjectID &b) |
ODEContactList * | GetContactFeedback (const ODEObjectID &a, const ODEObjectID &b) |
void | GetContactFeedback (const ODEObjectID &a, vector< ODEContactList * > &contacts) |
void | ClearContactFeedback () |
bool | InContact (const ODEObjectID &a) const |
bool | InContact (const ODEObjectID &a, const ODEObjectID &b) const |
void | DisableInstabilityCorrection () |
Disables instability correction for the next time step. This should be done if you manually set several objects' velocities, for example. | |
void | DisableInstabilityCorrection (const ODEObjectID &obj) |
Disables instability correction for the given object on the next time step. This should be done if you manually set an object's velocities, for example. | |
bool | ReadState_Internal (File &f) |
bool | WriteState_Internal (File &f) const |
void | DetectCollisions () |
void | SetupContactResponse () |
void | SetupContactResponse (const ODEObjectID &a, const ODEObjectID &b, int feedbackIndex, ODEContactResult &c) |
void | ClearCollisions () |
bool | InstabilityCorrection () |
virtual void | GetSurfaceParameters (const ODEObjectID &a, const ODEObjectID &b, dSurfaceParameters &surface) const |
Public Attributes | |
File | lastState |
Real | lastStateTimestep |
map< pair< ODEObjectID, ODEObjectID >, double > | lastMarginsRemaining |
An interface to the ODE simulator.
Step() performs collision detection, sets up contact response, calls StepDynamics(), and computes collision feedback.
StepDynamics() integrates the dynamics without setting up collision detection structures. This probably should not be used externally.
Read/WriteState can be used to serialize state to binary.
To get contact force information from the simulator, use the EnableContactFeedback() function to initialize feedback, and then call GetContactFeedback() to get a pointer to the feedback data structure. Contact forces are updated after Step().
enum ODESimulator::Status |
Overall simulation status flag. If a status is:
bool ODESimulator::CheckObjectOverlap | ( | vector< pair< ODEObjectID, ODEObjectID > > & | overlaps | ) |
Returns true if the current state is in "reliable" status. Otherwise returns false and populates the list of overlapping object pairs.