Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/story_entities/world.h @ 4179

Last change on this file since 4179 was 4176, checked in by bensch, 20 years ago

orxonox/trunk: merged the particleSystem into the Trunk

File size: 4.3 KB
Line 
1/*!
2    \file world.h
3    \brief Holds and manages all game data
4*/ 
5
6#ifndef _WORLD_H
7#define _WORLD_H
8
9#include "stdincl.h"
10#include "comincl.h"
11#include "story_entity.h"
12#include "p_node.h"
13#include "xmlparser/tinyxml.h"
14
15class World;
16class WorldEntity;
17class TrackManager;
18class Camera;
19class PNode;
20class GLMenuImageScreen;
21class LightManager;
22class ParticleEngine;
23class Terrain;
24class GarbageCollector;
25class Text;
26
27//! The game world Interface
28/**
29   this is a singleton interface, that enables world_entities to access the
30   world. for those objects, there is no easier way than over this interface!
31*/
32class WorldInterface : BaseObject {
33
34 public:
35  ~WorldInterface();
36  static WorldInterface* getInstance();
37  void init(World* world);
38  tList<WorldEntity>* getEntityList();
39
40 private:
41  WorldInterface();
42  static WorldInterface* singletonRef;    //!< singleton reference to this object
43  bool worldIsInitialized;                //!< true if the world has been initialized
44  World* worldReference;                  //!< this is a reference to the running world
45
46};
47
48//! The game world
49/**
50   this class initializes everything that should be displayed inside of the current level.
51   it is the main driving factor during gameplay.
52*/
53class World : public StoryEntity {
54
55 public:
56  World (char* name);
57  World (int worldID);
58  World (TiXmlElement* root);
59  virtual ~World ();
60
61  double getGameTime();
62
63  /* classes from story-entity */
64  virtual ErrorMessage preLoad();
65  virtual ErrorMessage load ();
66  virtual ErrorMessage init ();
67  virtual ErrorMessage start ();
68  virtual ErrorMessage stop ();
69  virtual ErrorMessage pause ();
70  virtual ErrorMessage resume ();
71  virtual ErrorMessage destroy ();
72
73  void loadDebugWorld(int worldID);
74
75  virtual void displayLoadScreen();
76  virtual void releaseLoadScreen();
77 
78  /* command node functions */
79  bool command (Command* cmd);
80
81  tList<WorldEntity>* getEntities();
82
83  /* interface to world */
84  void spawn (WorldEntity* entity);
85  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
86  void spawn(WorldEntity* entity, PNode* parentNode, Vector* relCoor, Quaternion* relDir, 
87             int parentingMode);
88
89  const char* getPath();
90  void setPath( const char* name);
91
92 private:
93  void constuctorInit(char* name, int worldID);
94
95  Uint32 lastFrame;                   //!< last time of frame
96  Uint32 dt;                          //!< time needed to calculate this frame
97  float dtS;                          //!< The time needed for caluculations in seconds
98  double gameTime;                    //!< this is where the game time is saved
99  bool bQuitOrxonox;                  //!< quit this application
100  bool bQuitCurrentGame;              //!< quit only the current game and return to menu
101  bool bPause;                        //!< pause mode
102
103  GLMenuImageScreen* glmis;           //!< The Level-Loader Display
104
105  char* worldName;                    //!< The name of this World
106  int debugWorldNr;                   //!< The Debug Nr. needed, if something goes wrong
107  char* path;                         //!< The file from which this world is loaded
108
109  PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
110  TrackManager* trackManager;         //!< The reference of the TrackManager that handles the course through the Level.
111  ParticleEngine* particleEngine;     //!< The ParticleEngine of the World.
112  Camera* localCamera;                //!< The current Camera
113  WorldEntity* sky;                   //!< The Environmental Heaven of orxonox \todo insert this to environment insted
114  LightManager* lightMan;             //!< The Lights of the Level
115  Terrain* terrain;                   //!< The Terrain of the World.
116
117  GLuint objectList;                  //!< temporary: \todo this will be ereased soon
118  tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
119  WorldEntity* localPlayer;           //!< The Player, you fly through the level.
120
121  GarbageCollector* garbageCollector; //!< reference to the garbage  collector
122
123  /* function for main-loop */
124  void mainLoop ();
125  void synchronize ();
126  void handleInput ();
127  void tick ();
128  void update ();
129  void collide ();
130  void draw ();
131  void display ();
132  void debug ();
133
134};
135
136#endif /* _WORLD_H */
Note: See TracBrowser for help on using the repository browser.