Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/particleEngine/src/story_entities/world.h @ 4128

Last change on this file since 4128 was 4128, checked in by bensch, 19 years ago

orxonox/branches/particleEngine: renders some particles again

File size: 4.2 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  double gameTime;                    //!< this is where the game time is saved
98  bool bQuitOrxonox;                  //!< quit this application
99  bool bQuitCurrentGame;              //!< quit only the current game and return to menu
100  bool bPause;                        //!< pause mode
101
102  GLMenuImageScreen* glmis;           //!< The Level-Loader Display
103
104  char* worldName;                    //!< The name of this World
105  int debugWorldNr;                   //!< The Debug Nr. needed, if something goes wrong
106  char* path;                         //!< The file from which this world is loaded
107
108  PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
109  TrackManager* trackManager;         //!< The reference of the TrackManager that handles the course through the Level.
110  ParticleEngine* particleEngine;     //!< The ParticleEngine of the World.
111  Camera* localCamera;                //!< The current Camera
112  WorldEntity* sky;                   //!< The Environmental Heaven of orxonox \todo insert this to environment insted
113  LightManager* lightMan;             //!< The Lights of the Level
114  Terrain* terrain;                   //!< The Terrain of the World.
115
116  GLuint objectList;                  //!< temporary: \todo this will be ereased soon
117  tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
118  WorldEntity* localPlayer;           //!< The Player, you fly through the level.
119
120  GarbageCollector* garbageCollector; //!< reference to the garbage  collector
121
122  /* function for main-loop */
123  void mainLoop ();
124  void synchronize ();
125  void handleInput ();
126  void tick ();
127  void update ();
128  void collide ();
129  void draw ();
130  void display ();
131  void debug ();
132
133};
134
135#endif /* _WORLD_H */
Note: See TracBrowser for help on using the repository browser.