Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/parenting/src/world.h @ 3307

Last change on this file since 3307 was 3306, checked in by patrick, 20 years ago

orxonox/branches/parenting: modified function passing routines - now having two lists: parenting list (tree) and entity list (array), that coexist - this is the only possibility to keep oversight.

File size: 1.9 KB
RevLine 
[2190]1/*!
2    \file world.h
3    \brief Holds and manages all game data
4*/ 
[1853]5
[3224]6#ifndef _WORLD_H
7#define _WORLD_H
[1853]8
[2190]9#include "stdincl.h"
[2636]10#include "story_entity.h"
[2190]11
[2636]12
13
[2190]14class Track;
[2077]15class WorldEntity;
[2636]16class Camera;
[3276]17class PNode;
[1883]18
[2190]19//! The game environment
[2636]20class World : public StoryEntity {
[1853]21
22 public:
[2636]23  World (char* name);
24  World (int worldID);
[3221]25  virtual ~World ();
[1853]26
[2636]27  template<typename T> 
[3225]28    T* spawn (Location* loc, WorldEntity* owner);       // template to be able to spawn any derivation of WorldEntity
[2636]29  template<typename T> 
[3225]30    T* spawn (Placement* plc, WorldEntity* owner);
[2636]31 
[3225]32  virtual ErrorMessage init ();
33  virtual ErrorMessage start ();
34  virtual ErrorMessage stop ();
35  virtual ErrorMessage pause ();
36  virtual ErrorMessage resume ();
[1917]37
[3225]38  virtual void load ();
39  virtual void destroy ();
[2636]40
[3225]41  void timeSlice (Uint32 deltaT);
[2636]42  void collide ();
43  void draw ();
44  void update ();       // maps Locations to Placements
[3225]45  void calcCameraPos (Location* loc, Placement* plc);
[2190]46       
[2636]47  void unload ();
[3225]48  bool command (Command* cmd);
[2636]49 
[3225]50  void setTrackLen (Uint32 tracklen);
51  int getTrackLen ();
[3216]52  //bool system_command (Command* cmd);
[3225]53  Camera* getCamera ();
[2644]54
[3225]55  void spawn (WorldEntity* entity);
[3306]56  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
[2644]57
[2822]58  tList<WorldEntity>* entities;
[2636]59 
60  // base level data
61  Track* track;
62  Uint32 tracklen;   // number of Tracks the World consist of
63  Vector* pathnodes;
64  Camera* localCamera; 
65
[1883]66 private:
[2636]67  Uint32 lastFrame; //!> last time of frame
68  bool bQuitOrxonox; //!> quit this application
69  bool bQuitCurrentGame; //!> quit only the current game and return to menu
70  bool bPause;
[1855]71
[2636]72  char* worldName;
73  int debugWorldNr;
[2731]74  GLuint objectList;
[2636]75
[2640]76  WorldEntity* localPlayer;
[3276]77 
78  PNode* nullParent;
79 
[3225]80  void mainLoop ();
81  void synchronize ();
[3226]82  void handleInput ();
[3225]83  void timeSlice ();
84  void collision ();
85  void display ();
86  void debug ();
[2190]87};
[1883]88
[3224]89#endif /* _WORLD_H */
Note: See TracBrowser for help on using the repository browser.