Class that handles the simulation loop, simulation timeline, timing and communicates with the main GUI thread via slots and signals. This class subclass QObject and is used by creating an instance of the class and then moving it to a thread with the "moveToThread(QThread*)" function.
More...
Public Slots |
virtual void | startSimulation () |
| Slot that checks if there's a world object. If so, initialize time variables and start the simulation loop. Otherwise exit.
|
virtual void | stopSimulation () |
| Slot that sets the simulating flag to false to stop the simulation loop.
|
virtual void | simulateTimeStep () |
| Slot that simulates a single time step. This function calls itself, unless the flag "simulateOneFrame" is set to true.
|
virtual void | simulateSingleTimeStep () |
| Slot that sets the "simulateOneFrame" to true and simulate a time step.
|
Signals |
void | simulationStoppedSignal () |
| Signal to tell parent widget that the simulation loop is done. This is used to make sure the simulation loop is done using the world object before the parent deletes it.
|
void | signalRelTimeChanged (double simTimeRelToRealTimeInstantaneous) |
| Signal to pass the time value of the simulation real time.
|
void | signalSendMessage (QString msg) |
| Signal to pass message to status bar in main window.
|
Public Member Functions |
| GripSimulation (dart::simulation::World *world, std::vector< GripTimeslice > *timeline, QList< GripTab * > *pluginLinst, MainWindow *parent=0, bool debug=false) |
| Macro to create meta-object code for the signals and slots.
|
| ~GripSimulation () |
| Destroys the GripSimulation object.
|
void | setWorld (dart::simulation::World *world) |
| Set the world object for the simulation.
|
void | reset () |
| Reset the GripSimulation object.
|
Protected Member Functions |
void | addWorldToTimeline (const dart::simulation::World &worldToAdd) |
| Adds a GripTimeslice to the timeline vector in order to store the world time and state in the timeline for playback or movie saving at a later time.
|
Protected Attributes |
dart::simulation::World * | _world |
| World object received from creator that we need to simulate.
|
std::vector< GripTimeslice > * | _timeline |
| Array of GripTimeSlice objects for simulation/kinematic playback.
|
QList< GripTab * > * | _plugins |
| List of plugin pointers in order call their functions every timestep of simulation.
|
QThread * | _thread |
| Local thread to move object into.
|
double | _simulationDuration |
| Simulation time in realtime.
|
double | _simulationStartTime |
| Initial system clock time when simulation started.
|
double | _simTimeRelToRealTimeInstantaneous |
| Simulation time relative to realtime (ie. 1.0 is realtime. 0.5 is half the speed of realtime)
|
double | _prevTime |
| Real time on the last time step.
|
bool | _simulating |
| Bool for whether or not we are simulating.
|
bool | _simulateOneFrame |
| Bool for whether or not to simulate only one frame.
|
bool | _debug |
| Bool for whether or not to print debug output to standard error.
|
Class that handles the simulation loop, simulation timeline, timing and communicates with the main GUI thread via slots and signals. This class subclass QObject and is used by creating an instance of the class and then moving it to a thread with the "moveToThread(QThread*)" function.