Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/branches/particleEngine: the first particles are being drawn :)

File size: 4.0 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
14
15class World;
16class WorldEntity;
17class TrackManager;
18class Camera;
19class PNode;
20class GLMenuImageScreen;
21class Skysphere;
22class SkyBox;
23class LightManager;
24class Terrain;
25class GarbageCollector;
26class Text;
27
28class ParticleEmitter;
29class ParticleSystem;
30
31//! The game world Interface
32/**
33   this is a singleton interface, that enables world_entities to access the
34   world. for those objects, there is no easier way than over this interface!
35*/
36class WorldInterface : BaseObject {
37
38 public:
39  ~WorldInterface();
40  static WorldInterface* getInstance();
41  void init(World* world);
42  tList<WorldEntity>* getEntityList();
43
44 private:
45  WorldInterface();
46  static WorldInterface* singletonRef;    //!< singleton reference to this object
47  bool worldIsInitialized;                //!< true if the world has been initialized
48  World* worldReference;                  //!< this is a reference to the running world
49
50};
51
52//! The game world
53/**
54   this class initializes everything that should be displayed inside of the current level.
55   it is the main driving factor during gameplay.
56*/
57class World : public StoryEntity {
58
59 public:
60  World (char* name);
61  World (int worldID);
62  virtual ~World ();
63
64  double getGameTime();
65
66  /* classes from story-entity */
67  virtual ErrorMessage preLoad();
68  virtual ErrorMessage load ();
69  virtual ErrorMessage init ();
70  virtual ErrorMessage start ();
71  virtual ErrorMessage stop ();
72  virtual ErrorMessage pause ();
73  virtual ErrorMessage resume ();
74  virtual ErrorMessage destroy ();
75
76  virtual void displayLoadScreen();
77  virtual void releaseLoadScreen();
78 
79  /* command node functions */
80  bool command (Command* cmd);
81
82  tList<WorldEntity>* getEntities();
83
84  /* interface to world */
85  void spawn (WorldEntity* entity);
86  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
87  void spawn(WorldEntity* entity, PNode* parentNode, Vector* relCoor, Quaternion* relDir, 
88             int parentingMode);
89
90
91 private:
92  void init(char* name, int worldID);
93
94  Uint32 lastFrame;                   //!< last time of frame
95  Uint32 dt;                          //!< time needed to calculate this frame
96  double gameTime;                    //!< this is where the game time is saved
97  bool bQuitOrxonox;                  //!< quit this application
98  bool bQuitCurrentGame;              //!< quit only the current game and return to menu
99  bool bPause;                        //!< pause mode
100
101  GLMenuImageScreen* glmis;           //!< The Level-Loader Display
102
103  char* worldName;                    //!< The name of this World
104  int debugWorldNr;                   //!< The Debug Nr. needed, if something goes wrong
105
106  PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
107  TrackManager* trackManager;         //!< The reference of the TrackManager that handles the course through the Level.
108  Camera* localCamera;                //!< The current Camera
109  Skysphere* skySphere;               //!< The Environmental Heaven of orxonox \todo insert this to environment insted
110  SkyBox* skyBox;
111  LightManager* lightMan;             //!< The Lights of the Level
112  Terrain* terrain;                   //!< The Terrain of the World.
113
114  ParticleSystem* testSystem;
115  ParticleEmitter* testEmitter;
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.