Changeset 4332 in orxonox.OLD for orxonox/branches/physics/src/story_entities
- Timestamp:
- May 27, 2005, 7:14:55 PM (20 years ago)
- Location:
- orxonox/branches/physics/src/story_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/story_entities/campaign.cc
r4283 r4332 110 110 ErrorMessage Campaign::start(int storyID = 0) 111 111 { 112 printf("World::start() - starting new StoryEntity Nr:%i\n", storyID);113 112 ErrorMessage errorCode; 114 113 if( !this->isInit) return errorCode; … … 119 118 while( se != NULL && this->running) 120 119 { 120 PRINTF(0)("Starting new StoryEntity Nr:%i\n", se->getStoryID()); 121 121 se->displayLoadScreen(); 122 122 se->preLoad(); … … 135 135 if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) ) 136 136 { 137 printf("Campaign::start() - quitting campaing story loop\n");137 PRINTF(0)("Quitting campaing story loop\n"); 138 138 if(se != NULL) 139 139 delete se; -
orxonox/branches/physics/src/story_entities/world.cc
r4314 r4332 27 27 #include "null_parent.h" 28 28 #include "helper_parent.h" 29 #include "pilot_node.h" 29 30 #include "track_node.h" 30 31 #include "world_entity.h" … … 201 202 void World::constuctorInit(char* name, int worldID) 202 203 { 203 this->setClass Name ("World");204 this->setClassID(CL_WORLD, "World"); 204 205 205 206 //this->worldName = name; … … 288 289 289 290 this->localCamera = new Camera(); 290 this->localCamera->setName (" camera");291 this->localCamera->setName ("Camera"); 291 292 292 293 State::getInstance()->setCamera(this->localCamera, this->localCamera->getTarget()); … … 308 309 { 309 310 PRINTF(1)("World has no path specified for loading"); 311 this->loadDebugWorld(this->getStoryID()); 310 312 return (ErrorMessage){213,"Path not specified","World::load()"}; 311 313 } … … 500 502 501 503 504 505 /** 506 \brief loads the debug world: only for experimental stuff 507 */ 502 508 void World::loadDebugWorld(int worldID) 503 509 { 510 printf("ajsdflkajs;dlfaj;slfja;lsjf;lajsf;la;sdfkja;lskdjfashdfklajshdflkjasdfh\n"); 504 511 /*monitor progress*/ 505 512 this->glmis->step(); … … 566 573 lightMan->setAmbientColor(.1,.1,.1); 567 574 lightMan->addLight(); 568 // lightMan->setAttenuation(1.0, .01, 0.0);569 // lightMan->setDiffuseColor(1,1,1);570 // lightMan->addLight(1);571 // lightMan->setPosition(20, 10, -20);572 // lightMan->setDiffuseColor(0,0,0);573 575 lightMan->debug(); 574 576 … … 585 587 lightMan->setPosition(-5.0, 10.0, -40.0); 586 588 587 // !\todo old track-system has to be removed 588 589 //create helper for player 590 //HelperParent* hp = new HelperParent (); 591 /* the player has to be added to this helper */ 592 593 // create a player 589 594 590 this->localPlayer = new Player (); 595 591 this->localPlayer->setName ("player"); 596 592 this->spawn (this->localPlayer); 597 593 /*monitor progress*/ 598 //this->glmis->step();599 594 this->glmis->step(); 600 595 601 // bind input602 Orxonox *orx = Orxonox::getInstance ();603 orx->getLocalInput()->bind (this->localPlayer);604 605 596 // bind camera 606 597 this->localCamera = new Camera(); 607 598 this->localCamera->setName ("camera"); 608 609 599 /*monitor progress*/ 610 600 this->glmis->step(); 611 601 612 sky = new SkyBox();613 // (SkyBox*)(sky)->setTexture("pictures/sky/skybox", "jpg");614 sky->setParent(localCamera);615 this->spawn(sky);616 617 /*monitor progress*/618 this->glmis->step();619 620 621 WorldEntity* env = new Environment();622 env->setName ("env");623 this->spawn(env);624 625 626 /*627 Vector* es = new Vector (10, 5, 0);628 Quaternion* qs = new Quaternion ();629 WorldEntity* pr = new Primitive(P_CYLINDER);630 pr->setName("primitive");631 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);632 */633 634 /*monitor progress*/635 this->glmis->step();636 637 // trackManager->setBindSlave(env);638 PNode* tn = trackManager->getTrackNode();639 tn->addChild(this->localPlayer);640 this->localCamera->lookAt(tn);641 642 //localCamera->setParent(TrackNode::getInstance());643 tn->addChild(this->localCamera);644 // localCamera->lookAt(tn);645 this->localPlayer->setMode(PNODE_ALL);646 //Vector* cameraOffset = new Vector (0, 5, -10);647 trackManager->condition(2, LEFTRIGHT, this->localPlayer);648 this->glmis->step();649 break;650 }651 case DEBUG_WORLD_1:652 {653 lightMan->setPosition(.0, .0, .0);654 lightMan->setAttenuation(1.0, .01, 0.0);655 lightMan->setSpecularColor(1,0,0);656 this->nullParent = NullParent::getInstance ();657 this->nullParent->setName ("NullParent");658 659 // create a player660 WorldEntity* myPlayer = new Player();661 myPlayer->setName ("player");662 this->spawn(myPlayer);663 this->localPlayer = myPlayer;664 665 // bind input666 Orxonox *orx = Orxonox::getInstance();667 orx->getLocalInput()->bind (myPlayer);668 669 // bind camera670 this->localCamera = new Camera ();671 this->localCamera->setName ("camera");672 this->localCamera->lookAt(LightManager::getInstance()->getLight(0));673 this->localCamera->setParent(this->localPlayer);674 675 // Create SkySphere676 sky = new Skysphere("pictures/sky-replace.jpg");677 this->localPlayer->addChild(this->sky);678 this->spawn(this->sky);679 Vector* es = new Vector (20, 0, 0);680 Quaternion* qs = new Quaternion ();681 682 lightMan->getLight(0)->setParent(trackManager->getTrackNode());683 break;684 }685 case DEBUG_WORLD_2:686 {687 lightMan->setAmbientColor(.1,.1,.1);688 lightMan->addLight();689 lightMan->setPosition(-5.0, 10.0, -40.0);690 this->nullParent = NullParent::getInstance ();691 this->nullParent->setName ("NullParent");692 693 // !\todo old track-system has to be removed694 695 //create helper for player696 //HelperParent* hp = new HelperParent ();697 /* the player has to be added to this helper */698 699 // create a player700 this->localPlayer = new Player ();701 this->localPlayer->setName ("player");702 this->spawn (this->localPlayer);703 /*monitor progress*/704 //this->glmis->step();705 this->glmis->step();706 707 // bind input708 Orxonox *orx = Orxonox::getInstance ();709 orx->getLocalInput()->bind (this->localPlayer);710 711 // bind camera712 this->localCamera = new Camera();713 this->localCamera->setName ("camera");714 this->localCamera->lookAt(this->localPlayer);715 this->localCamera->setParent(this->localPlayer);716 717 /*monitor progress*/718 this->glmis->step();719 602 720 603 // Create SkySphere … … 728 611 729 612 730 WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2); 731 this->localPlayer->addChild(baseNode); 732 baseNode->setRelCoor(Vector(10.0, 2.0, 1.0)); 733 this->spawn(baseNode); 734 735 WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0); 736 baseNode->addChild(secondNode); 737 secondNode->setRelCoor(Vector(0.0, 0.0, 3.0)); 738 this->spawn(secondNode); 739 740 741 WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0); 742 secondNode->addChild(thirdNode); 743 thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0)); 744 this->spawn(thirdNode); 745 746 747 748 WorldEntity* c = new Environment(); 749 this->localPlayer->addChild(c); 750 c->setRelCoor(Vector(10.0, 2.0, -1.0)); 751 this->spawn(c); 752 753 754 755 Animation3D* animation = new Animation3D(c); 756 animation->setInfinity(ANIM_INF_REPLAY); 757 758 759 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 760 animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 761 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 762 763 764 765 766 767 768 /* 769 KeyFrame* f1 = new KeyFrame; 770 f1->position = new Vector(-1.1, 0.0, 2.6); 771 f1->direction = new Quaternion(); 772 f1->time = 1.0; 773 f1->mode = NEG_EXP; 774 775 776 KeyFrame* f2 = new KeyFrame; 777 f2->position = new Vector(-2.1, 0.0, 2.6); 778 f2->direction = new Quaternion(); 779 f2->time = 0.1; 780 f2->mode = NEG_EXP; 781 782 KeyFrame* f3 = new KeyFrame; 783 f3->position = new Vector(10.0, 2.0, -1.0); 784 f3->direction = new Quaternion(); 785 f3->time = 0.2; 786 f3->mode = NEG_EXP; 787 788 KeyFrame* f4 = new KeyFrame; 789 f4->position = new Vector(10.0, 5.0, -1.0); 790 f4->direction = new Quaternion(); 791 f4->time = 1.0; 792 f4->mode = NEG_EXP; 793 794 795 796 this->simpleAnimation->animatorBegin(); 797 this->simpleAnimation->selectObject(b); 798 this->simpleAnimation->setAnimationMode(SINGLE); 799 this->simpleAnimation->addKeyFrame(f1); 800 this->simpleAnimation->addKeyFrame(f2); 801 this->simpleAnimation->start(); 802 this->simpleAnimation->selectObject(c); 803 this->simpleAnimation->addKeyFrame(f3); 804 this->simpleAnimation->addKeyFrame(f4); 805 this->simpleAnimation->start(); 806 this->simpleAnimation->animatorEnd(); 807 */ 808 809 /* 810 Vector* es = new Vector (10, 5, 0); 811 Quaternion* qs = new Quaternion (); 812 WorldEntity* pr = new Primitive(P_CYLINDER); 813 pr->setName("primitive"); 814 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT); 815 */ 816 613 terrain = new Terrain("worlds/newGround.obj"); 614 terrain->setRelCoor(Vector(0,-10,0)); 615 this->spawn(terrain); 817 616 /*monitor progress*/ 818 617 this->glmis->step(); 819 618 820 // trackManager->setBindSlave(env); 619 this->pilotNode = new PilotNode(); 620 this->pilotNode->addChild(this->localPlayer); 621 this->pilotNode->addChild(this->localCamera); 622 // bind input 623 Orxonox *orx = Orxonox::getInstance (); 624 //orx->getLocalInput()->bind (this->pilotNode); 625 626 /* 821 627 PNode* tn = trackManager->getTrackNode(); 822 628 tn->addChild(this->localPlayer); 823 824 //localCamera->setParent(TrackNode::getInstance());629 this->localCamera->lookAt(tn); 630 825 631 tn->addChild(this->localCamera); 826 // localCamera->lookAt(tn);827 632 this->localPlayer->setMode(PNODE_ALL); 828 //Vector* cameraOffset = new Vector (0, 5, -10);829 633 trackManager->condition(2, LEFTRIGHT, this->localPlayer); 634 */ 830 635 this->glmis->step(); 636 break; 637 } 638 case DEBUG_WORLD_1: 639 { 640 641 break; 642 } 643 case DEBUG_WORLD_2: 644 { 831 645 832 646 break; 833 647 } 834 648 default: 835 printf("World::load() - no world with ID %i found", this->debugWorldNr );649 break; 836 650 } 837 651 } … … 848 662 { 849 663 this->bPause = false; 664 this->pilotNode = NULL; 850 665 CommandNode* cn = Orxonox::getInstance()->getLocalInput(); 851 666 cn->addToWorld(this); … … 1321 1136 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT); 1322 1137 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP); 1323 1138 else if(this->pilotNode != NULL) if( !strcmp( cmd->cmd, "cursor")) this->pilotNode->command(cmd); 1324 1139 return false; 1325 1140 } -
orxonox/branches/physics/src/story_entities/world.h
r4283 r4332 24 24 class Text; 25 25 class TiXmlElement; 26 class PilotNode; 26 27 27 28 //! The game world Interface … … 123 124 tList<WorldEntity>* entities; //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them. 124 125 WorldEntity* localPlayer; //!< The Player, you fly through the level. 126 PilotNode* pilotNode; //!< THe pilot node to fly with the mouse 125 127 126 128 GarbageCollector* garbageCollector; //!< reference to the garbage collector
Note: See TracChangeset
for help on using the changeset viewer.