Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/story_entities/world.cc @ 3646

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

orxonox/trunk: implemented garbage collector, is not yet collecting, i have to update the list.h first.

File size: 21.2 KB
Line 
1
2/*
3   orxonox - the future of 3D-vertical-scrollers
4
5   Copyright (C) 2004 orx
6
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2, or (at your option)
10   any later version.
11
12   ### File Specific:
13   main-programmer: Patrick Boenzli
14   co-programmer: Christian Meyer
15*/
16
17#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
18
19#include "world.h"
20
21#include "orxonox.h"
22
23#include "p_node.h"
24#include "null_parent.h"
25#include "helper_parent.h"
26#include "track_node.h"
27#include "world_entity.h"
28#include "player.h"
29#include "camera.h"
30#include "environment.h"
31#include "primitive.h"
32#include "skysphere.h"
33#include "terrain.h"
34#include "light.h"
35
36#include "track_manager.h"
37#include "garbage_collector.h"
38
39#include "command_node.h"
40#include "glmenu_imagescreen.h"
41#include "fontset.h"
42#include "list.h"
43
44
45
46using namespace std;
47
48
49WorldInterface* WorldInterface::singletonRef = 0;
50
51
52/**
53   \brief private constructor because of singleton
54*/
55WorldInterface::WorldInterface()
56{
57  this->worldIsInitialized = false;
58  this->worldReference = NULL;
59}
60
61/**
62   \brief public deconstructor
63*/
64WorldInterface::~WorldInterface()
65{
66  this->singletonRef = NULL;
67  this->worldIsInitialized = false;
68  this->worldReference = NULL;
69}
70
71/**
72   \brief gets the singleton instance
73   \returns singleton instance
74*/
75WorldInterface* WorldInterface::getInstance()
76{
77  if( singletonRef == NULL)
78    singletonRef = new WorldInterface();
79  return singletonRef;
80}
81
82
83/**
84   \brief initializes the interface
85   \param reference to the world
86
87   if the worldinterface is not initilizes, there wont be any
88   useable interface
89*/
90void WorldInterface::init(World* world)
91{
92  this->worldReference = world;
93  if( world != NULL)
94    {
95      this->worldIsInitialized = true;
96      PRINTF(3)("WorldInterface up and running\n");
97    }
98}
99
100
101/**
102   \brief gets the entity list from the world
103   \return entity list
104*/
105tList<WorldEntity>* WorldInterface::getEntityList()
106{
107  if( this->worldIsInitialized)
108    return this->worldReference->getEntities();
109  PRINT(1)("Someone tried to use the WorldInterface before it has been initizlized! this can result in SEGFAULTs!\n");
110  return NULL;
111}
112
113
114
115/**
116    \brief create a new World
117   
118    This creates a new empty world!
119*/
120World::World (char* name)
121{
122  this->init(name, -1);
123  //NullParent* np = NullParent::getInstance();
124}
125
126/**
127   \brief creates a new World...
128   \param worldID with this ID
129*/
130World::World (int worldID)
131{
132  this->init(NULL, worldID);
133}
134
135/**
136    \brief remove the World from memory
137   
138    delete everything explicitly, that isn't contained in the parenting tree!
139    things contained in the tree are deleted automaticaly
140*/
141World::~World ()
142{
143  PRINTF(3)("World::~World() - deleting current world\n");
144  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
145  cn->unbind(this->localPlayer);
146  cn->reset();
147
148  delete WorldInterface::getInstance();
149
150  delete this->nullParent;
151  delete this->entities;
152  delete this->lightMan;
153  delete this->trackManager;
154}
155
156/**
157   \brief initializes the world.
158
159   set all stuff here that is world generic and does not use to much memory
160   because the real init() function StoryEntity::init() will be called
161   shortly before start of the game. 
162   since all worlds are initiated/referenced before they will be started.
163   NO LEVEL LOADING HERE - NEVER!
164*/
165void World::init(char* name, int worldID)
166{
167  this->setClassName ("World");
168
169  this->worldName = name;
170  this->debugWorldNr = worldID;
171  this->entities = new tList<WorldEntity>();
172}
173
174
175/**
176   \brief this is executed before load
177
178   since the load function sometimes needs data, that has been init before
179   the load and after the proceeding storyentity has finished
180*/
181ErrorMessage World::preLoad()
182{
183  /* init the world interface */
184  WorldInterface* wi = WorldInterface::getInstance();
185  wi->init(this);
186  this->garbageCollector = GarbageCollector::getInstance();
187}
188
189
190/**
191   \brief loads the World by initializing all resources, and set their default values.
192*/
193ErrorMessage World::load()
194{
195  //  BezierCurve* tmpCurve = new BezierCurve();
196  if(this->debugWorldNr != -1)
197    {
198      // initializing Font
199      testFont = new FontSet();
200      testFont->buildFont("../data/pictures/font.tga");
201
202      // initializing the TrackManager
203      trackManager = TrackManager::getInstance();
204      trackManager->addPoint(Vector(0,0,0));
205      trackManager->addPoint(Vector(100, -40, 5));
206      trackManager->addPoint(Vector(200,-40,-8));
207      trackManager->addPoint(Vector(250, -35, -2));
208      trackManager->addPoint(Vector(320,-33,-.55));
209      trackManager->setDuration(3);
210      trackManager->setSavePoint();
211      trackManager->addPoint(Vector(410, 0, 0));
212      trackManager->addPoint(Vector(510, 20, -10));
213      trackManager->addPoint(Vector(550, 20, -10));
214      trackManager->addPoint(Vector(570, 20, -10));
215      trackManager->setDuration(5);
216     
217      int fork11, fork12;
218      trackManager->fork(2, &fork11, &fork12);
219      trackManager->workOn(fork11);
220      trackManager->addPoint(Vector(640, 25, -30));
221      trackManager->addPoint(Vector(700, 40, -120));
222      trackManager->addPoint(Vector(800, 50, -150));
223      trackManager->addPoint(Vector(900, 60, -100));
224      trackManager->addPoint(Vector(900, 60, -70));
225      trackManager->addPoint(Vector(990, 65, -15));
226      trackManager->addPoint(Vector(1050, 65, -10));
227      trackManager->addPoint(Vector(1100, 65, -20));
228      trackManager->setDuration(10);
229
230      trackManager->workOn(fork12);
231      trackManager->addPoint(Vector(640, 25, 20));
232      trackManager->addPoint(Vector(670, 50, 120));
233      trackManager->addPoint(Vector(700, 70, 80));
234      trackManager->addPoint(Vector(800, 70, 65));
235      trackManager->addPoint(Vector(850, 65, 65));
236      trackManager->addPoint(Vector(920, 35, 40));
237      trackManager->addPoint(Vector(945, 40, 40));
238      trackManager->addPoint(Vector(970, 24, 40));
239      trackManager->addPoint(Vector(1000, 40, -7));
240      trackManager->setDuration(10);
241     
242
243      trackManager->join(2, fork11, fork12);
244
245      trackManager->workOn(5);
246      trackManager->addPoint(Vector(1200, 60, -50));
247      trackManager->addPoint(Vector(1300, 50, -50));
248      trackManager->addPoint(Vector(1400, 40, -50));
249      trackManager->addPoint(Vector(1500, 40, -60));
250      trackManager->addPoint(Vector(1600, 35, -55));
251      trackManager->addPoint(Vector(1700, 45, -40));
252      trackManager->addPoint(Vector(1750, 60, -40));
253      trackManager->addPoint(Vector(1770, 80, -40));
254      trackManager->addPoint(Vector(1800, 100, -40));
255      trackManager->setDuration(10);
256
257      trackManager->finalize();
258
259     
260      /*monitor progress*/
261      this->glmis->step();
262
263      // LIGHT initialisation
264      lightMan = LightManager::getInstance();
265      lightMan->setAmbientColor(.1,.1,.1);
266      lightMan->addLight();
267      //      lightMan->setAttenuation(1.0, .01, 0.0);
268      //      lightMan->setDiffuseColor(1,1,1);
269      //  lightMan->addLight(1);
270      //  lightMan->setPosition(20, 10, -20);
271      //  lightMan->setDiffuseColor(0,0,0);
272      lightMan->debug();
273
274      switch(this->debugWorldNr)
275        {
276          /*
277            this loads the hard-coded debug world. this only for simplicity and will be
278            removed by a reald world-loader, which interprets a world-file.
279            if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
280            make whatever you want...
281           */
282        case DEBUG_WORLD_0:
283          {
284            lightMan->setPosition(-5.0, 10.0, -40.0);
285            this->nullParent = NullParent::getInstance ();
286            this->nullParent->setName ("NullParent");
287
288            // !\todo old track-system has to be removed
289
290            //create helper for player
291            //HelperParent* hp = new HelperParent ();
292            /* the player has to be added to this helper */
293
294            // create a player
295            this->localPlayer = new Player ();
296            this->localPlayer->setName ("player");
297            this->spawn (this->localPlayer);
298            /*monitor progress*/
299            this->glmis->step();           
300
301            // bind input
302            Orxonox *orx = Orxonox::getInstance ();
303            orx->getLocalInput()->bind (this->localPlayer);
304           
305            // bind camera
306            this->localCamera = new Camera();
307            this->localCamera->setName ("camera");
308            this->localCamera->lookAt(this->localPlayer);
309            this->localCamera->setParent(this->localPlayer);
310           
311            /*monitor progress*/
312            this->glmis->step();           
313
314            // Create SkySphere
315            this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
316            this->skySphere->setName("SkySphere");
317            this->localCamera->addChild(this->skySphere);
318            this->skySphere->setMode(PNODE_MOVEMENT);
319
320            /*monitor progress*/
321            this->glmis->step();
322
323           
324            WorldEntity* env = new Environment();
325            env->setName ("env");
326            this->spawn(env);
327
328           
329            Vector* es = new Vector (10, 5, 0);
330            Quaternion* qs = new Quaternion ();
331            WorldEntity* pr = new Primitive(P_CYLINDER);
332            pr->setName("primitive");
333            this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
334           
335
336            /*monitor progress*/
337            this->glmis->step();
338
339            //      trackManager->setBindSlave(env);
340            PNode* tn = trackManager->getTrackNode();
341            tn->addChild(this->localPlayer);
342
343            //localCamera->setParent(TrackNode::getInstance());
344            tn->addChild(this->localCamera);
345            //      localCamera->lookAt(tn);
346            this->localPlayer->setMode(PNODE_ALL);
347            //Vector* cameraOffset = new Vector (0, 5, -10);
348            trackManager->condition(2, LEFTRIGHT, this->localPlayer);
349
350            break;
351          }
352        case DEBUG_WORLD_1:
353          {
354            lightMan->setPosition(.0, .0, .0);
355            lightMan->setAttenuation(1.0, .01, 0.0);
356            lightMan->setSpecularColor(1,0,0);
357            this->nullParent = NullParent::getInstance ();
358            this->nullParent->setName ("NullParent");
359
360            // create a player
361            WorldEntity* myPlayer = new Player();
362            myPlayer->setName ("player");
363            this->spawn(myPlayer);
364            this->localPlayer = myPlayer;           
365           
366            // bind input
367            Orxonox *orx = Orxonox::getInstance();
368            orx->getLocalInput()->bind (myPlayer);
369           
370            // bind camera
371            this->localCamera = new Camera ();
372            this->localCamera->setName ("camera");
373            this->localCamera->lookAt(LightManager::getInstance()->getLight(0));
374            this->localCamera->setParent(this->localPlayer);
375
376            // Create SkySphere
377            skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
378            this->localPlayer->addChild(this->skySphere);
379
380            Vector* es = new Vector (20, 0, 0);
381            Quaternion* qs = new Quaternion ();
382            WorldEntity* pr = new Primitive(P_SPHERE);
383            pr->setName("primitive");
384            this->spawn(pr, this->localPlayer, es, qs, PNODE_ROTATE_AND_MOVE);
385
386            lightMan->getLight(0)->setParent(trackManager->getTrackNode());
387            break;
388          }
389        default:
390          printf("World::load() - no world with ID %i found", this->debugWorldNr );
391        }
392    }
393  else if(this->worldName != NULL)
394    {
395
396    }
397
398  // initialize debug coord system
399  objectList = glGenLists(1);
400  glNewList (objectList, GL_COMPILE);
401 
402  trackManager->drawGraph(.01);
403  trackManager->debug(2);
404  glEndList();
405
406  terrain = new Terrain("../data/worlds/newGround.obj");
407  terrain->setRelCoor(new Vector(0,-10,0));
408  this->spawn(terrain);
409
410}
411
412
413/**
414   \brief initializes a new World shortly before start
415
416   this is the function, that will be loaded shortly before the world is
417   started
418*/
419ErrorMessage World::init()
420{
421  this->bPause = false;
422  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
423  cn->addToWorld(this);
424  cn->enable(true);
425}
426
427
428/**
429   \brief starts the World
430*/
431ErrorMessage World::start()
432{
433  PRINTF(3)("World::start() - starting current World: nr %i\n", this->debugWorldNr);
434  this->bQuitOrxonox = false;
435  this->bQuitCurrentGame = false;
436  this->mainLoop();
437}
438
439/**
440   \brief stops the world.
441
442   This happens, when the player decides to end the Level.
443*/
444ErrorMessage World::stop()
445{
446  PRINTF(3)("World::stop() - got stop signal\n");
447  this->bQuitCurrentGame = true;
448}
449
450/**
451   \brief pauses the Game
452*/
453ErrorMessage World::pause()
454{
455  this->isPaused = true;
456}
457
458/**
459   \brief ends the pause Phase
460*/
461ErrorMessage World::resume()
462{
463  this->isPaused = false;
464}
465
466/**
467   \brief destroys the World
468*/
469ErrorMessage World::destroy()
470{
471
472}
473
474/**
475   \brief shows the loading screen
476*/
477void World::displayLoadScreen ()
478{
479  PRINTF(3)("World::displayLoadScreen - start\n"); 
480 
481  //GLMenuImageScreen*
482  this->glmis = GLMenuImageScreen::getInstance();
483  this->glmis->init();
484  this->glmis->setMaximum(10);
485  this->glmis->draw();
486 
487  PRINTF(3)("World::displayLoadScreen - end\n"); 
488}
489
490/**
491   \brief removes the loadscreen, and changes over to the game
492
493   \todo take out the delay
494*/
495void World::releaseLoadScreen ()
496{
497  PRINTF(3)("World::releaseLoadScreen - start\n"); 
498  this->glmis->setValue(this->glmis->getMaximum());
499  SDL_Delay(500);
500  PRINTF(3)("World::releaseLoadScreen - end\n"); 
501}
502
503
504/**
505   \brief gets the list of entities from the world
506   \returns entity list
507*/
508tList<WorldEntity>* World::getEntities()
509{
510  return this->entities;
511}
512
513
514/**
515   \brief this returns the current game time
516   \returns elapsed game time
517*/
518double World::getGameTime()
519{
520  return this->gameTime;
521}
522
523
524/**
525    \brief checks for collisions
526   
527    This method runs through all WorldEntities known to the world and checks for collisions
528    between them. In case of collisions the collide() method of the corresponding entities
529    is called.
530*/
531void World::collide ()
532{
533  /*
534  List *a, *b;
535  WorldEntity *aobj, *bobj;
536   
537  a = entities;
538 
539  while( a != NULL)
540    {
541      aobj = a->nextElement();
542      if( aobj->bCollide && aobj->collisioncluster != NULL)
543        {
544          b = a->nextElement();
545          while( b != NULL )
546            {
547              bobj = b->nextElement();
548              if( bobj->bCollide && bobj->collisioncluster != NULL )
549                {
550                  unsigned long ahitflg, bhitflg;
551                  if( check_collision ( &aobj->place, aobj->collisioncluster,
552                                        &ahitflg, &bobj->place, bobj->collisioncluster,
553                                        &bhitflg) );
554                  {
555                    aobj->collide (bobj, ahitflg, bhitflg);
556                    bobj->collide (aobj, bhitflg, ahitflg);
557                  }
558                }
559              b = b->nextElement();
560            }
561        }
562      a = a->enumerate();
563    }
564  */
565}
566
567/**
568    \brief runs through all entities calling their draw() methods
569*/
570void World::draw ()
571{
572  /* draw entities */
573  WorldEntity* entity;
574  glLoadIdentity();
575
576  entity = this->entities->enumerate();
577  while( entity != NULL ) 
578    { 
579      if( entity->bDraw ) entity->draw();
580      entity = this->entities->nextElement();
581    } 
582 
583  glCallList (objectList);
584  //! \todo skysphere is a WorldEntity and should be inside of the world-entity-list.
585  skySphere->draw();
586
587  testFont->printText(0, 0, 1, "orxonox_" PACKAGE_VERSION);
588
589  lightMan->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes //
590}
591
592
593/**
594   \brief function to put your own debug stuff into it. it can display informations about
595   the current class/procedure
596*/
597void World::debug()
598{
599  PRINTF(2)("debug() - starting debug\n");
600  PNode* p1 = NullParent::getInstance ();
601  PNode* p2 = new PNode (new Vector(2, 2, 2), p1);
602  PNode* p3 = new PNode (new Vector(4, 4, 4), p1);
603  PNode* p4 = new PNode (new Vector(6, 6, 6), p2);
604
605  p1->debug ();
606  p2->debug ();
607  p3->debug ();
608  p4->debug ();
609
610  p1->shiftCoor (new Vector(-1, -1, -1));
611
612  printf("World::debug() - shift\n");
613  p1->debug ();
614  p2->debug ();
615  p3->debug ();
616  p4->debug ();
617 
618  p1->update (0);
619
620  printf ("World::debug() - update\n");
621  p1->debug ();
622  p2->debug ();
623  p3->debug ();
624  p4->debug ();
625
626  p2->shiftCoor (new Vector(-1, -1, -1));
627  p1->update (0);
628
629  p1->debug ();
630  p2->debug ();
631  p3->debug ();
632  p4->debug ();
633
634  p2->setAbsCoor (new Vector(1,2,3));
635
636
637 p1->update (0);
638
639  p1->debug ();
640  p2->debug ();
641  p3->debug ();
642  p4->debug ();
643
644  delete p1;
645 
646 
647  /*
648  WorldEntity* entity;
649  printf("counting all entities\n");
650  printf("World::debug() - enumerate()\n");
651  entity = entities->enumerate(); 
652  while( entity != NULL )
653    {
654      if( entity->bDraw ) printf("got an entity\n");
655      entity = entities->nextElement();
656    }
657  */
658}
659
660
661/**
662  \brief main loop of the world: executing all world relevant function
663
664  in this loop we synchronize (if networked), handle input events, give the heart-beat to
665  all other member-entities of the world (tick to player, enemies etc.), checking for
666  collisions drawing everything to the screen.
667*/
668void World::mainLoop()
669{
670  this->lastFrame = SDL_GetTicks ();
671  PRINTF(3)("World::mainLoop() - Entering main loop\n");
672  while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */
673    {
674      PRINTF(3)("World::mainloop() - number of entities: %i\n", this->entities->getSize());
675      // Network
676      this->synchronize ();
677      // Process input
678      this->handleInput ();
679      if( this->bQuitCurrentGame || this->bQuitOrxonox)
680          break;
681      // Process time
682      this->tick ();
683      // Update the state
684      this->update ();     
685      // Process collision
686      this->collide ();
687      // Draw
688      this->display ();
689
690      //      for( int i = 0; i < 5000000; i++) {}
691      /* \todo this is to slow down the program for openGl Software emulator computers, reimplement*/
692    }
693  PRINTF(3)("World::mainLoop() - Exiting the main loop\n");
694}
695
696
697/**
698   \brief synchronize local data with remote data
699*/
700void World::synchronize ()
701{
702  // Get remote input
703  // Update synchronizables
704}
705
706
707/**
708   \brief run all input processing
709
710   the command node is the central input event dispatcher. the node uses the even-queue from
711   sdl and has its own event-passing-queue.
712*/
713void World::handleInput ()
714{
715  // localinput
716  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
717  cn->process();
718  // remoteinput
719}
720
721
722/**
723   \brief advance the timeline
724
725   this calculates the time used to process one frame (with all input handling, drawing, etc)
726   the time is mesured in ms and passed to all world-entities and other classes that need
727   a heart-beat.
728*/
729void World::tick ()
730{
731  Uint32 currentFrame = SDL_GetTicks();
732  if(!this->bPause)
733    {
734      this->dt = currentFrame - this->lastFrame;
735     
736      if( this->dt > 0)
737        {
738          float fps = 1000/dt;
739          PRINTF(3)("fps = %f\n", fps);
740        }
741      else
742        {
743          /* the frame-rate is limited to 100 frames per second, all other things are for
744             nothing.
745          */
746          PRINTF(2)("fps = 1000 - frame rate is adjusted\n");
747          SDL_Delay(10);
748          this->dt = 10;
749        }
750      //this->timeSlice (dt);
751     
752      /* function to let all entities tick (iterate through list) */
753      WorldEntity* entity;
754      float seconds = this->dt / 1000.0;     
755      this->gameTime += seconds;
756      entity = entities->enumerate(); 
757      while( entity != NULL) 
758        { 
759          entity->tick (seconds);
760          entity = entities->nextElement();
761        }
762      //skySphere->updatePosition(localCamera->absCoordinate);
763     
764      /* update tick the rest */
765      this->trackManager->tick(this->dt);
766      this->localCamera->tick(this->dt);
767      this->garbageCollector->tick(seconds);
768    }
769  this->lastFrame = currentFrame;
770}
771
772
773/**
774   \brief this function gives the world a consistant state
775
776   after ticking (updating the world state) this will give a constistant
777   state to the whole system.
778*/
779void World::update()
780{
781  this->garbageCollector->update();
782  this->nullParent->update (dt);
783}
784
785
786/**
787   \brief render the current frame
788   
789   clear all buffers and draw the world
790*/
791void World::display ()
792{
793  // clear buffer
794  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
795  // set camera
796  this->localCamera->apply ();
797  // draw world
798  this->draw();
799  // draw HUD
800  /* \todo draw HUD */
801  // flip buffers
802  SDL_GL_SwapBuffers();
803  //SDL_Surface* screen = Orxonox::getInstance()->getScreen ();
804  //SDL_Flip (screen);
805}
806
807
808/**
809   \brief add and spawn a new entity to this world
810   \param entity to be added
811*/
812void World::spawn(WorldEntity* entity)
813{
814  this->entities->add (entity);
815  entity->postSpawn ();
816}
817
818
819/**
820   \brief add and spawn a new entity to this world
821   \param entity to be added
822   \param absCoor At what coordinates to add this entity.
823   \param absDir In which direction should it look.
824*/
825void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
826{
827  this->entities->add (entity);
828
829  entity->setAbsCoor (absCoor);
830  entity->setAbsDir (absDir);
831
832  entity->postSpawn ();
833}
834
835
836/**
837   \brief add and spawn a new entity to this world
838   \param entity to be added
839   \param entity to be added to (PNode)
840   \param At what relative  coordinates to add this entity.
841   \param In which relative direction should it look.
842*/
843void World::spawn(WorldEntity* entity, PNode* parentNode, 
844                  Vector* relCoor, Quaternion* relDir, 
845                  int parentingMode)
846{
847  this->nullParent = NullParent::getInstance();
848  if( parentNode != NULL)
849    {
850      parentNode->addChild (entity);
851     
852      entity->setRelCoor (relCoor);
853      entity->setRelDir (relDir);
854      entity->setMode(parentingMode);
855     
856      this->entities->add (entity);
857     
858      entity->postSpawn ();
859    }
860}
861
862
863
864/**
865  \brief commands that the world must catch
866  \returns false if not used by the world
867*/
868bool World::command(Command* cmd)
869{
870  if( !strcmp( cmd->cmd, "view0")) this->localCamera->setViewMode(VIEW_NORMAL);
871  else if( !strcmp( cmd->cmd, "view1")) this->localCamera->setViewMode(VIEW_BEHIND);
872  else if( !strcmp( cmd->cmd, "view2")) this->localCamera->setViewMode(VIEW_FRONT);
873  else if( !strcmp( cmd->cmd, "view3")) this->localCamera->setViewMode(VIEW_LEFT);
874  else if( !strcmp( cmd->cmd, "view4")) this->localCamera->setViewMode(VIEW_RIGHT);
875  else if( !strcmp( cmd->cmd, "view5")) this->localCamera->setViewMode(VIEW_TOP);
876 
877  return false;
878}
879
Note: See TracBrowser for help on using the repository browser.