Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3461 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Mar 9, 2005, 1:23:33 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: cleaning up old stuff in world.cc and its relatives. second step…

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world.cc

    r3459 r3461  
    221221            this->localCamera = new Camera(this);
    222222            this->localCamera->setName ("camera");
    223             this->getCamera()->bind (myPlayer);
     223            this->localCamera->bind (myPlayer);
    224224            this->localPlayer->addChild (this->localCamera);
    225225
     
    273273            this->localCamera = new Camera (this);
    274274            this->localCamera->setName ("camera");
    275             this->getCamera()->bind (myPlayer);
     275            this->localCamera->bind (myPlayer);
    276276            this->localPlayer->addChild (this->localCamera);
    277277
     
    660660}
    661661
    662 /**
    663     \brief updates Placements and notifies entities when they left the
    664     world
    665    
    666     This runs trough all WorldEntities and maps Locations to Placements
    667     if they are bound, checks whether they left the level boundaries
    668     and calls appropriate functions.
    669 */
    670 void World::update ()
    671 {
    672   /*
    673   //List<WorldEntity> *l;
    674   WorldEntity* entity;
    675   Location* loc;
    676   Placement* plc;
    677   Uint32 t;
    678  
    679   //  l = entities->enumerate();
    680   entity = this->entities->enumerate();
    681   while( entity != NULL )
    682     {
    683 
    684      
    685       if( !entity->isFree() )
    686         {
    687           loc = entity->getLocation();
    688           plc = entity->getPlacement();
    689           t = loc->part;
    690          
    691           if( t >= traclen )
    692             {
    693               printf("An entity is out of the game area\n");
    694               entity->leftWorld ();
    695             }
    696           else
    697             {
    698               while( track[t].mapCoords( loc, plc) )
    699                 {
    700                   track[t].postLeave (entity);
    701                   if( loc->part >= tracklen )
    702                     {
    703                       printf("An entity has left the game area\n");
    704                       entity->leftWorld ();
    705                       break;
    706                     }
    707                   track[loc->part].postEnter (entity);
    708                 }
    709             }
    710         }
    711       else
    712         {
    713         }
    714      
    715       entity = entities->nextElement();
    716     }
    717   */ 
    718 }
    719 
    720662
    721663/**
     
    891833     
    892834      /* update tick the rest */
    893       this->update ();
    894835      this->localCamera->timeSlice(dt);
    895836      this->trackManager->tick(dt);
     
    920861}
    921862
    922 /**
    923    \brief give back active camera
    924    
    925    this passes back the actualy active camera
    926    \todo ability to define more than one camera or camera-places
    927 */
    928 Camera* World::getCamera()
    929 {
    930   return this->localCamera;
    931 }
    932 
    933863
    934864/**
  • orxonox/trunk/src/world.h

    r3459 r3461  
    4444  virtual void displayLoadScreen();
    4545  virtual void releaseLoadScreen();
    46 
    47 
    48   /* main functions for world-looping */
    49 
    50   void draw ();
    51   void update ();       // maps Locations to Placements
    52   //void calcCameraPos (Location* loc, Placement* plc);
    53        
     46 
     47  /* command node functions */
    5448  bool command (Command* cmd);
    5549
    56  
    57   //bool system_command (Command* cmd);
    58   Camera* getCamera ();
    59 
     50  /* interface to world */
    6051  void spawn (WorldEntity* entity);
    6152  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
    6253
    63   tList<WorldEntity>* entities;//!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
    64  
    65   // base level data
    66   TrackManager* trackManager;  //!< The reference of the TrackManager that handles the course through the Level.
    67   Camera* localCamera;         //!< The current Camera
    6854
    6955
    7056 private:
     57  TrackManager* trackManager;  //!< The reference of the TrackManager that handles the course through the Level.
     58  Camera* localCamera;         //!< The current Camera
     59  tList<WorldEntity>* entities;//!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
     60
    7161  Uint32 lastFrame;             //!< last time of frame
    7262  bool bQuitOrxonox;            //!< quit this application
     
    9282  void timeSlice ();
    9383  void collide ();
     84  void draw ();
    9485  void display ();
    9586  void debug ();
Note: See TracChangeset for help on using the changeset viewer.