Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: naming of animation changed
Anim → Animation
tAnim → tAnimation
Animation → Animation3D

@paede: i hope you like it.

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