Changeset 3461 in orxonox.OLD
- Timestamp:
- Mar 9, 2005, 1:23:33 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world.cc
r3459 r3461 221 221 this->localCamera = new Camera(this); 222 222 this->localCamera->setName ("camera"); 223 this-> getCamera()->bind (myPlayer);223 this->localCamera->bind (myPlayer); 224 224 this->localPlayer->addChild (this->localCamera); 225 225 … … 273 273 this->localCamera = new Camera (this); 274 274 this->localCamera->setName ("camera"); 275 this-> getCamera()->bind (myPlayer);275 this->localCamera->bind (myPlayer); 276 276 this->localPlayer->addChild (this->localCamera); 277 277 … … 660 660 } 661 661 662 /**663 \brief updates Placements and notifies entities when they left the664 world665 666 This runs trough all WorldEntities and maps Locations to Placements667 if they are bound, checks whether they left the level boundaries668 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 else697 {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 else712 {713 }714 715 entity = entities->nextElement();716 }717 */718 }719 720 662 721 663 /** … … 891 833 892 834 /* update tick the rest */ 893 this->update ();894 835 this->localCamera->timeSlice(dt); 895 836 this->trackManager->tick(dt); … … 920 861 } 921 862 922 /**923 \brief give back active camera924 925 this passes back the actualy active camera926 \todo ability to define more than one camera or camera-places927 */928 Camera* World::getCamera()929 {930 return this->localCamera;931 }932 933 863 934 864 /** -
orxonox/trunk/src/world.h
r3459 r3461 44 44 virtual void displayLoadScreen(); 45 45 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 */ 54 48 bool command (Command* cmd); 55 49 56 57 //bool system_command (Command* cmd); 58 Camera* getCamera (); 59 50 /* interface to world */ 60 51 void spawn (WorldEntity* entity); 61 52 void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); 62 53 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 data66 TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level.67 Camera* localCamera; //!< The current Camera68 54 69 55 70 56 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 71 61 Uint32 lastFrame; //!< last time of frame 72 62 bool bQuitOrxonox; //!< quit this application … … 92 82 void timeSlice (); 93 83 void collide (); 84 void draw (); 94 85 void display (); 95 86 void debug ();
Note: See TracChangeset
for help on using the changeset viewer.