Changeset 3727 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Apr 5, 2005, 7:44:05 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/game_loader.cc
r3629 r3727 101 101 102 102 World* world1 = new World(DEBUG_WORLD_1); 103 world1->setNextStoryID(WORLD_ID_ GAMEEND);103 world1->setNextStoryID(WORLD_ID_2); 104 104 debugCampaign->addEntity(world1, WORLD_ID_1); 105 106 World* world2 = new World(DEBUG_WORLD_2); 107 world2->setNextStoryID(WORLD_ID_GAMEEND); 108 debugCampaign->addEntity(world2, WORLD_ID_2); 105 109 106 110 this->currentCampaign = debugCampaign; -
orxonox/trunk/src/simple_animation.cc
r3726 r3727 26 26 27 27 28 SimpleAnimation* SimpleAnimation::singletonRef = 0; 29 /** 30 \brief gets the singleton instance 31 \returns singleton instance 32 */ 33 SimpleAnimation* SimpleAnimation::getInstance() 34 { 35 if( singletonRef == NULL) 36 singletonRef = new SimpleAnimation(); 37 return singletonRef; 38 } 39 28 40 /** 29 41 \brief standard constructor 30 42 */ 31 SimpleAnimation::SimpleAnimation ( PNode* parent)43 SimpleAnimation::SimpleAnimation () 32 44 { 33 45 this->setClassName ("SimpleAnimation"); … … 35 47 this->localTime = 0; 36 48 this->bRunning = false; 37 this->parent = parent;38 49 this->currentFrame = NULL; 39 50 this->lastFrame = NULL; … … 61 72 62 73 74 /** 75 \brief this determines the start of an Animator Describtion 76 77 this can then be followed by different commands like addKeyFrame(..) etc. and 78 will be closed with AnimatiorEnd() 79 */ 80 void SimpleAnimation::AnimatorBegin() 81 { 82 this->bDescriptive = true; 83 } 84 85 86 /** 87 \brief this determines the end of an Animator Describtion 88 89 this can then be followed by different commands like addKeyFrame(..) etc. and 90 will be closed with AnimatiorEnd() 91 */ 92 void SimpleAnimation::AnimatorEnd() 93 { 94 this->workingObject = NULL; 95 this->bDescriptive = false; 96 } 97 98 99 /** 100 \brief select an object to work on by using this function 101 \param object wo work on 102 */ 103 void SimpleAnimation::selectObject(WorldEntity* entity) 104 { 105 this->workingObject = entity; 106 } 107 108 63 109 64 110 /** … … 70 116 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time) 71 117 { 118 if( !this->bDescriptive) 119 { 120 PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n"); 121 return; 122 } 72 123 KeyFrame* frame = new KeyFrame; 73 124 frame->position = point; … … 75 126 frame->time = time; 76 127 frame->mode = DEFAULT_ANIMATION_MODE; 128 frame->object = this->workingObject; 77 129 this->frames->add(frame); 78 130 } … … 88 140 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode) 89 141 { 142 if( !this->bDescriptive) 143 { 144 PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n"); 145 return; 146 } 90 147 KeyFrame* frame = new KeyFrame; 91 148 frame->position = point; … … 93 150 frame->time = time; 94 151 frame->mode = mode; 152 frame->object = this->workingObject; 95 153 this->frames->add(frame); 96 154 } … … 102 160 void SimpleAnimation::addKeyFrame(KeyFrame* frame) 103 161 { 104 if( frame != NULL) 105 this->frames->add(frame); 162 if( !this->bDescriptive) 163 { 164 PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n"); 165 return; 166 } 167 frame->object = this->workingObject; 168 this->frames->add(frame); 106 169 } 107 170 -
orxonox/trunk/src/simple_animation.h
r3726 r3727 43 43 44 44 public: 45 SimpleAnimation(PNode* parent); 46 virtual ~SimpleAnimation(); 45 static SimpleAnimation* getInstance(); 47 46 47 void AnimatorBegin(); 48 void AnimatorEnd(); 49 void selectObject(WorldEntity* entity); 48 50 void addKeyFrame(Vector* point, Quaternion* orientation, float time); 49 51 void addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode); 50 52 void addKeyFrame(KeyFrame* frame); 51 53 void reset(); 54 52 55 53 56 void start(); … … 60 63 61 64 private: 65 SimpleAnimation(); 66 virtual ~SimpleAnimation(); 67 68 static SimpleAnimation* singletonRef; 62 69 bool bRunning; //<! is set, when the animation is running 63 70 tList<KeyFrame>* frames; //<! where keyframes are stored in … … 69 76 70 77 Vector* tmpVect; //<! this is the temporary vector save place - 71 78 WorldEntity* workingObject; //<! this is a pointer to the current working object that has been selected via selectObject() 79 bool bDescriptive; //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands 72 80 }; 73 81 -
orxonox/trunk/src/story_entities/world.cc
r3710 r3727 390 390 391 391 lightMan->getLight(0)->setParent(trackManager->getTrackNode()); 392 break; 393 } 394 case DEBUG_WORLD_2: 395 { 396 lightMan->setPosition(-5.0, 10.0, -40.0); 397 this->nullParent = NullParent::getInstance (); 398 this->nullParent->setName ("NullParent"); 399 400 // !\todo old track-system has to be removed 401 402 //create helper for player 403 //HelperParent* hp = new HelperParent (); 404 /* the player has to be added to this helper */ 405 406 // create a player 407 this->localPlayer = new Player (); 408 this->localPlayer->setName ("player"); 409 this->spawn (this->localPlayer); 410 /*monitor progress*/ 411 //this->glmis->step(); 412 this->glmis->step(); 413 414 // bind input 415 Orxonox *orx = Orxonox::getInstance (); 416 orx->getLocalInput()->bind (this->localPlayer); 417 418 // bind camera 419 this->localCamera = new Camera(); 420 this->localCamera->setName ("camera"); 421 this->localCamera->lookAt(this->localPlayer); 422 this->localCamera->setParent(this->localPlayer); 423 424 /*monitor progress*/ 425 this->glmis->step(); 426 427 // Create SkySphere 428 this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg"); 429 this->skySphere->setName("SkySphere"); 430 this->localCamera->addChild(this->skySphere); 431 this->skySphere->setMode(PNODE_MOVEMENT); 432 433 /*monitor progress*/ 434 this->glmis->step(); 435 436 437 WorldEntity* env = new Environment(); 438 env->setName ("env"); 439 this->spawn(env); 440 441 442 /* 443 Vector* es = new Vector (10, 5, 0); 444 Quaternion* qs = new Quaternion (); 445 WorldEntity* pr = new Primitive(P_CYLINDER); 446 pr->setName("primitive"); 447 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT); 448 */ 449 450 /*monitor progress*/ 451 this->glmis->step(); 452 453 // trackManager->setBindSlave(env); 454 PNode* tn = trackManager->getTrackNode(); 455 tn->addChild(this->localPlayer); 456 457 //localCamera->setParent(TrackNode::getInstance()); 458 tn->addChild(this->localCamera); 459 // localCamera->lookAt(tn); 460 this->localPlayer->setMode(PNODE_ALL); 461 //Vector* cameraOffset = new Vector (0, 5, -10); 462 trackManager->condition(2, LEFTRIGHT, this->localPlayer); 463 this->glmis->step(); 464 392 465 break; 393 466 } -
orxonox/trunk/src/story_entities/world.h
r3646 r3727 24 24 class Terrain; 25 25 class GarbageCollector; 26 class SimpleAnimation; 26 27 27 28 //! The game world Interface … … 88 89 void init(char* name, int worldID); 89 90 90 Uint32 lastFrame; //!< last time of frame91 Uint32 dt; //!< time needed to calculate this frame92 double gameTime; //!< this is where the game time is saved93 bool bQuitOrxonox; //!< quit this application94 bool bQuitCurrentGame; //!< quit only the current game and return to menu95 bool bPause; //!< pause mode91 Uint32 lastFrame; //!< last time of frame 92 Uint32 dt; //!< time needed to calculate this frame 93 double gameTime; //!< this is where the game time is saved 94 bool bQuitOrxonox; //!< quit this application 95 bool bQuitCurrentGame; //!< quit only the current game and return to menu 96 bool bPause; //!< pause mode 96 97 97 FontSet* testFont; //!< A test Font. \todo fix this, so it is for real.98 GLMenuImageScreen* glmis; //!< The Level-Loader Display98 FontSet* testFont; //!< A test Font. \todo fix this, so it is for real. 99 GLMenuImageScreen* glmis; //!< The Level-Loader Display 99 100 100 char* worldName; //!< The name of this World101 int debugWorldNr; //!< The Debug Nr. needed, if something goes wrong101 char* worldName; //!< The name of this World 102 int debugWorldNr; //!< The Debug Nr. needed, if something goes wrong 102 103 103 PNode* nullParent; //!< The zero-point, that everything has as its parent.104 TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level.105 Camera* localCamera; //!< The current Camera106 Skysphere* skySphere; //!< The Environmental Heaven of orxonox \todo insert this to environment insted107 LightManager* lightMan; //!< The Lights of the Level108 Terrain* terrain; //!< The Terrain of the World.104 PNode* nullParent; //!< The zero-point, that everything has as its parent. 105 TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level. 106 Camera* localCamera; //!< The current Camera 107 Skysphere* skySphere; //!< The Environmental Heaven of orxonox \todo insert this to environment insted 108 LightManager* lightMan; //!< The Lights of the Level 109 Terrain* terrain; //!< The Terrain of the World. 109 110 110 GLuint objectList; //!< temporary: \todo this will be ereased soon111 tList<WorldEntity>* entities; //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.112 WorldEntity* localPlayer; //!< The Player, you fly through the level.111 GLuint objectList; //!< temporary: \todo this will be ereased soon 112 tList<WorldEntity>* entities; //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them. 113 WorldEntity* localPlayer; //!< The Player, you fly through the level. 113 114 114 115 GarbageCollector* garbageCollector; //!< reference to the garbage collector 116 117 SimpleAnimation* simpleAnimation; //!< reference to the SimpleAnimation object 115 118 116 119 /* function for main-loop */
Note: See TracChangeset
for help on using the changeset viewer.