World.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef WORLD_HH
00028 #define WORLD_HH
00029
00030 #include "Geom.hh"
00031 #include "Model.hh"
00032 #include "Sensor.hh"
00033
00034
00035 class WorldFile;
00036 class WorldFileNode;
00037
00038 typedef struct gz_server gz_server_t;
00039 typedef struct gz_sim gz_sim_t;
00040
00041
00047 class World
00048 {
00049
00050 public: World(int serverId, bool serverForce);
00051
00052
00053 public: virtual ~World();
00054
00058 public: int Load( WorldFile *worldFile );
00059
00060
00061 public: int LoadModel( WorldFileNode *node, Model *parent );
00062
00063
00064 private: int LoadPlugin(const char* pluginname, const char *worldfilepath);
00065
00069 public: void SetModelPose( Model *model, GzPose pose );
00070
00076 public: void ResetModelPoses();
00077
00081 public: int Save();
00082
00083
00084 public: int Initialize();
00085
00086
00087 public: int Finalize();
00088
00089
00090 public: void Step();
00091
00092
00093 private: static void CollisionCallback( void *data, dGeomID o1, dGeomID o2 );
00094
00096 public: double GetSimTime();
00097
00102 public: double GetPauseTime();
00103
00105 public: double GetRealTime();
00106
00108 public: double GetWallTime();
00109
00111 public: double GetDayTime();
00112
00114 public: int GetNumModels() const;
00115
00117 public: Model **GetModels() const;
00118
00120 private: void AddModel( Model *model );
00121
00122
00123 public: dSpaceID GetSpaceId() {return this->spaceId;}
00124
00125
00126 private: WorldFile *worldFile;
00127
00128
00129 public: int server_id;
00130 private: bool server_force;
00131
00132
00133 public: gz_server_t *gz_server;
00134 private: gz_sim_t *gz_sim;
00135
00136
00137 public: dWorldID worldId;
00138
00139
00140 private: dSpaceID spaceId;
00141
00142
00143 private: int modelCount, modelMaxCount;
00144 private: Model **models;
00145
00146
00147 private: dJointGroupID contactGroup;
00148
00150 public: double simSpeed;
00151
00153 private: double stepTime;
00154
00156 private: bool pause;
00157
00159 private: double simTime, pauseTime, startTime;
00160
00161
00162 private: GzVector gravity;
00163
00164
00165 private: double dayTime;
00166
00168 public: double utcOffset;
00169
00172 public: GzVector utmZone;
00173
00175 public: GzVector utmOffset;
00176
00177
00178 public: GzColor skyColor;
00179
00180
00181 public: bool fogEnable;
00182 public: double fogDensity;
00183 public: GzColor fogColor;
00184
00185
00186
00187 friend class Model;
00188 };
00189
00190 #endif
00191
Last updated 12 September 2005 21:38:45
|