Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/md2_loader/src/story_entities/world.h @ 4151

Last change on this file since 4151 was 4138, checked in by patrick, 19 years ago

orxonox/branches/md2_loader: modified the MD2Model class so it is able to draw the model, very bad style, just debugging the code. Some worse hacks in world class

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