#include <simulation.h>
Inherits Base, and Configurable.
Inherited by ThisSim.
Inheritance diagram for Simulation:
Public Types | |
none | |
initialised | |
running | |
closed | |
enum | SimulationState { none, initialised, running, closed } |
Public Member Functions | |
Simulation () | |
virtual | ~Simulation () |
bool | run (int argc, char **argv) |
starts the Simulation. | |
virtual void | start (const OdeHandle &, const OsgHandle &, GlobalData &globalData)=0 |
start() is called at the start and should create all the object (obstacles, agents...). | |
virtual void | end (GlobalData &globalData) |
end() is called at the end and should tidy up | |
virtual bool | config (GlobalData &globalData) |
config() is called when the user presses Ctrl-C | |
virtual bool | command (const OdeHandle &, const OsgHandle &, GlobalData &globalData, int key, bool down) |
is called if a key was pressed. | |
virtual void | bindingDescription (osg::ApplicationUsage &au) const |
this can be used to describe the key bindings used by command() | |
virtual bool | collCallback (const OdeHandle &, void *data, dGeomID o1, dGeomID o2) |
collCallback() can be used to overload the standart collision handling. | |
virtual void | addCallback (GlobalData &globalData, bool draw, bool pause, bool control) |
optional additional callback function which is called every simulation step. | |
void | onPostDraw (const osg::Camera &c) |
virtual void | odeStep () |
virtual void | osgStep () |
Protected Member Functions | |
virtual bool | handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &) |
virtual void | getUsage (osg::ApplicationUsage &au) const |
virtual void | accept (osgGA::GUIEventHandlerVisitor &v) |
virtual bool | init (int argc, char **argv) |
void | setCameraHomePos (const osg::Vec3 &eye, const osg::Vec3 &view) |
define the home position and view orientation of the camera. | |
bool | control_c_pressed () |
void | processCmdLine (int argc, char **argv) |
void | resetSyncTimer () |
long | timeOfDayinMS () |
Static Protected Member Functions | |
static void | nearCallback_TopLevel (void *data, dGeomID o1, dGeomID o2) |
static void | nearCallback (void *data, dGeomID o1, dGeomID o2) |
Protected Attributes | |
std::list< PlotOption > | plotoptions |
std::list< const Configurable * > | globalconfigurables |
this list contains by default only the odeconfig. This list os passed to the plotoptions. | |
GlobalData | globalData |
VideoStream | videostream |
int | nextLeakAnnounce |
int | leakAnnCounter |
long | realtimeoffset |
long | simtimeoffset |
double | truerealtimefactor |
bool | justresettimes |
paramval | windowWidth |
paramval | windowHeight |
bool | pause |
bool | simulation_time_reached |
long int | simulation_time |
bool | noGraphics |
long | sim_step |
int | guiloggerinterval |
int | filelogginginterval |
int | neuronvizinterval |
char | odeRobotsCfg [256] |
enum SimulationState |
Simulation | ( | ) |
~Simulation | ( | ) | [virtual] |
void accept | ( | osgGA::GUIEventHandlerVisitor & | v | ) | [protected, virtual] |
virtual void addCallback | ( | GlobalData & | globalData, | |
bool | draw, | |||
bool | pause, | |||
bool | control | |||
) | [inline, virtual] |
optional additional callback function which is called every simulation step.
Called between physical simulation step and drawing.
draw | indicates that objects are drawn in this timestep | |
pause | always false (only called of simulation is running) | |
control | indicates that robots have been controlled this timestep |
virtual void bindingDescription | ( | osg::ApplicationUsage & | au | ) | const [inline, virtual] |
virtual bool collCallback | ( | const OdeHandle & | , | |
void * | data, | |||
dGeomID | o1, | |||
dGeomID | o2 | |||
) | [inline, virtual] |
collCallback() can be used to overload the standart collision handling.
However it is called after the robots collision handling.
virtual bool command | ( | const OdeHandle & | , | |
const OsgHandle & | , | |||
GlobalData & | globalData, | |||
int | key, | |||
bool | down | |||
) | [inline, virtual] |
is called if a key was pressed.
For keycodes see: osgGA::GUIEventAdapter
Reimplemented in ThisSim.
bool config | ( | GlobalData & | globalData | ) | [virtual] |
bool control_c_pressed | ( | ) | [protected] |
void end | ( | GlobalData & | globalData | ) | [virtual] |
end() is called at the end and should tidy up
void getUsage | ( | osg::ApplicationUsage & | au | ) | const [protected, virtual] |
bool handle | ( | const osgGA::GUIEventAdapter & | ea, | |
osgGA::GUIActionAdapter & | ||||
) | [protected, virtual] |
bool init | ( | int | argc, | |
char ** | argv | |||
) | [protected, virtual] |
void nearCallback | ( | void * | data, | |
dGeomID | o1, | |||
dGeomID | o2 | |||
) | [static, protected] |
void nearCallback_TopLevel | ( | void * | data, | |
dGeomID | o1, | |||
dGeomID | o2 | |||
) | [static, protected] |
void odeStep | ( | ) | [virtual] |
void onPostDraw | ( | const osg::Camera & | c | ) |
void osgStep | ( | ) | [virtual] |
void processCmdLine | ( | int | argc, | |
char ** | argv | |||
) | [protected] |
void resetSyncTimer | ( | ) | [protected] |
bool run | ( | int | argc, | |
char ** | argv | |||
) |
starts the Simulation.
Do not overload it. This function returns of the simulation is terminated.
define the home position and view orientation of the camera.
view.x is the heading angle in degree. view.y is the tilt angle in degree (nick), view.z is ignored
virtual void start | ( | const OdeHandle & | , | |
const OsgHandle & | , | |||
GlobalData & | globalData | |||
) | [pure virtual] |
long timeOfDayinMS | ( | ) | [protected] |
int filelogginginterval [protected] |
std::list<const Configurable*> globalconfigurables [protected] |
this list contains by default only the odeconfig. This list os passed to the plotoptions.
GlobalData globalData [protected] |
int guiloggerinterval [protected] |
bool justresettimes [protected] |
int leakAnnCounter [protected] |
int neuronvizinterval [protected] |
int nextLeakAnnounce [protected] |
bool noGraphics [protected] |
char odeRobotsCfg[256] [protected] |
bool pause [protected] |
std::list<PlotOption> plotoptions [protected] |
long realtimeoffset [protected] |
long sim_step [protected] |
long simtimeoffset [protected] |
long int simulation_time [protected] |
bool simulation_time_reached [protected] |
double truerealtimefactor [protected] |
VideoStream videostream [protected] |
paramval windowHeight [protected] |
paramval windowWidth [protected] |