Changeset 4324 in orxonox.OLD
- Timestamp:
- May 27, 2005, 2:13:19 AM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/campaign.cc
r4261 r4324 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/trunk/src/story_entities/world.cc
r4320 r4324 280 280 281 281 this->localCamera = new Camera(); 282 this->localCamera->setName (" camera");282 this->localCamera->setName ("Camera"); 283 283 284 284 GraphicsEngine::getInstance()->displayFPS(true); … … 298 298 { 299 299 PRINTF(1)("World has no path specified for loading"); 300 this->loadDebugWorld(this->getStoryID()); 300 301 return (ErrorMessage){213,"Path not specified","World::load()"}; 301 302 } … … 471 472 472 473 474 473 475 void World::loadDebugWorld(int worldID) 474 476 { 477 printf("ajsdflkajs;dlfaj;slfja;lsjf;lajsf;la;sdfkja;lskdjfashdfklajshdflkjasdfh\n"); 475 478 /*monitor progress*/ 476 479 this->glmis->step(); … … 537 540 lightMan->setAmbientColor(.1,.1,.1); 538 541 lightMan->addLight(); 539 // lightMan->setAttenuation(1.0, .01, 0.0);540 // lightMan->setDiffuseColor(1,1,1);541 // lightMan->addLight(1);542 // lightMan->setPosition(20, 10, -20);543 // lightMan->setDiffuseColor(0,0,0);544 542 lightMan->debug(); 545 543 … … 556 554 lightMan->setPosition(-5.0, 10.0, -40.0); 557 555 558 // !\todo old track-system has to be removed559 560 //create helper for player561 //HelperParent* hp = new HelperParent ();562 /* the player has to be added to this helper */563 556 564 557 // create a player … … 581 574 this->glmis->step(); 582 575 583 sky = new SkyBox();584 // (SkyBox*)(sky)->setTexture("pictures/sky/skybox", "jpg");585 sky->setParent(localCamera);586 this->spawn(sky);587 588 /*monitor progress*/589 this->glmis->step();590 591 592 WorldEntity* env = new Environment();593 env->setName ("env");594 this->spawn(env);595 596 597 /*598 Vector* es = new Vector (10, 5, 0);599 Quaternion* qs = new Quaternion ();600 WorldEntity* pr = new Primitive(P_CYLINDER);601 pr->setName("primitive");602 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);603 */604 605 /*monitor progress*/606 this->glmis->step();607 608 // trackManager->setBindSlave(env);609 PNode* tn = trackManager->getTrackNode();610 tn->addChild(this->localPlayer);611 this->localCamera->lookAt(tn);612 613 //localCamera->setParent(TrackNode::getInstance());614 tn->addChild(this->localCamera);615 // localCamera->lookAt(tn);616 this->localPlayer->setMode(PNODE_ALL);617 //Vector* cameraOffset = new Vector (0, 5, -10);618 trackManager->condition(2, LEFTRIGHT, this->localPlayer);619 this->glmis->step();620 break;621 }622 case DEBUG_WORLD_1:623 {624 lightMan->setPosition(.0, .0, .0);625 lightMan->setAttenuation(1.0, .01, 0.0);626 lightMan->setSpecularColor(1,0,0);627 this->nullParent = NullParent::getInstance ();628 this->nullParent->setName ("NullParent");629 630 // create a player631 WorldEntity* myPlayer = new Player();632 myPlayer->setName ("player");633 this->spawn(myPlayer);634 this->localPlayer = myPlayer;635 636 // bind input637 Orxonox *orx = Orxonox::getInstance();638 orx->getLocalInput()->bind (myPlayer);639 640 // bind camera641 this->localCamera = new Camera ();642 this->localCamera->setName ("camera");643 this->localCamera->lookAt(LightManager::getInstance()->getLight(0));644 this->localCamera->setParent(this->localPlayer);645 646 // Create SkySphere647 sky = new Skysphere("pictures/sky-replace.jpg");648 this->localPlayer->addChild(this->sky);649 this->spawn(this->sky);650 Vector* es = new Vector (20, 0, 0);651 Quaternion* qs = new Quaternion ();652 653 lightMan->getLight(0)->setParent(trackManager->getTrackNode());654 break;655 }656 case DEBUG_WORLD_2:657 {658 lightMan->setAmbientColor(.1,.1,.1);659 lightMan->addLight();660 lightMan->setPosition(-5.0, 10.0, -40.0);661 this->nullParent = NullParent::getInstance ();662 this->nullParent->setName ("NullParent");663 664 // !\todo old track-system has to be removed665 666 //create helper for player667 //HelperParent* hp = new HelperParent ();668 /* the player has to be added to this helper */669 670 // create a player671 this->localPlayer = new Player ();672 this->localPlayer->setName ("player");673 this->spawn (this->localPlayer);674 /*monitor progress*/675 //this->glmis->step();676 this->glmis->step();677 678 // bind input679 Orxonox *orx = Orxonox::getInstance ();680 orx->getLocalInput()->bind (this->localPlayer);681 682 // bind camera683 this->localCamera = new Camera();684 this->localCamera->setName ("camera");685 this->localCamera->lookAt(this->localPlayer);686 this->localCamera->setParent(this->localPlayer);687 688 /*monitor progress*/689 this->glmis->step();690 576 691 577 // Create SkySphere … … 699 585 700 586 701 WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2); 702 this->localPlayer->addChild(baseNode); 703 baseNode->setRelCoor(Vector(10.0, 2.0, 1.0)); 704 this->spawn(baseNode); 705 706 WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0); 707 baseNode->addChild(secondNode); 708 secondNode->setRelCoor(Vector(0.0, 0.0, 3.0)); 709 this->spawn(secondNode); 710 711 712 WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0); 713 secondNode->addChild(thirdNode); 714 thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0)); 715 this->spawn(thirdNode); 716 717 718 719 WorldEntity* c = new Environment(); 720 this->localPlayer->addChild(c); 721 c->setRelCoor(Vector(10.0, 2.0, -1.0)); 722 this->spawn(c); 723 724 725 726 Animation3D* animation = new Animation3D(c); 727 animation->setInfinity(ANIM_INF_REPLAY); 728 729 730 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 731 animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 732 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 733 734 735 736 737 738 739 /* 740 KeyFrame* f1 = new KeyFrame; 741 f1->position = new Vector(-1.1, 0.0, 2.6); 742 f1->direction = new Quaternion(); 743 f1->time = 1.0; 744 f1->mode = NEG_EXP; 745 746 747 KeyFrame* f2 = new KeyFrame; 748 f2->position = new Vector(-2.1, 0.0, 2.6); 749 f2->direction = new Quaternion(); 750 f2->time = 0.1; 751 f2->mode = NEG_EXP; 752 753 KeyFrame* f3 = new KeyFrame; 754 f3->position = new Vector(10.0, 2.0, -1.0); 755 f3->direction = new Quaternion(); 756 f3->time = 0.2; 757 f3->mode = NEG_EXP; 758 759 KeyFrame* f4 = new KeyFrame; 760 f4->position = new Vector(10.0, 5.0, -1.0); 761 f4->direction = new Quaternion(); 762 f4->time = 1.0; 763 f4->mode = NEG_EXP; 764 765 766 767 this->simpleAnimation->animatorBegin(); 768 this->simpleAnimation->selectObject(b); 769 this->simpleAnimation->setAnimationMode(SINGLE); 770 this->simpleAnimation->addKeyFrame(f1); 771 this->simpleAnimation->addKeyFrame(f2); 772 this->simpleAnimation->start(); 773 this->simpleAnimation->selectObject(c); 774 this->simpleAnimation->addKeyFrame(f3); 775 this->simpleAnimation->addKeyFrame(f4); 776 this->simpleAnimation->start(); 777 this->simpleAnimation->animatorEnd(); 778 */ 779 780 /* 781 Vector* es = new Vector (10, 5, 0); 782 Quaternion* qs = new Quaternion (); 783 WorldEntity* pr = new Primitive(P_CYLINDER); 784 pr->setName("primitive"); 785 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT); 786 */ 787 587 terrain = new Terrain("worlds/newGround.obj"); 588 terrain->setRelCoor(Vector(0,-10,0)); 589 this->spawn(terrain); 788 590 /*monitor progress*/ 789 591 this->glmis->step(); 790 592 791 // trackManager->setBindSlave(env);792 593 PNode* tn = trackManager->getTrackNode(); 793 594 tn->addChild(this->localPlayer); 794 795 //localCamera->setParent(TrackNode::getInstance()); 595 this->localCamera->lookAt(tn); 596 597 796 598 tn->addChild(this->localCamera); 797 // localCamera->lookAt(tn);798 599 this->localPlayer->setMode(PNODE_ALL); 799 //Vector* cameraOffset = new Vector (0, 5, -10);800 600 trackManager->condition(2, LEFTRIGHT, this->localPlayer); 801 601 this->glmis->step(); 602 break; 603 } 604 case DEBUG_WORLD_1: 605 { 606 607 break; 608 } 609 case DEBUG_WORLD_2: 610 { 802 611 803 612 break; 804 613 } 805 614 default: 806 printf("World::load() - no world with ID %i found", this->debugWorldNr );615 break; 807 616 } 808 617 } -
orxonox/trunk/src/util/loading/game_loader.cc
r4262 r4324 82 82 delete campaignName; 83 83 } 84 World* world0 = new World(DEBUG_WORLD_0); 85 world0->setNextStoryID(WORLD_ID_GAMEEND); 86 this->currentCampaign->addEntity(world0, WORLD_ID_2); 84 87 } 85 88 -
orxonox/trunk/src/util/object_manager.cc
r4322 r4324 19 19 #include "list.h" 20 20 21 #include "projectile.h"22 21 23 22 using namespace std; … … 72 71 this->managedObjectList[index]->add(object); 73 72 else 74 PRINTF(0)(" Error: unable to add object to the list nr. %i: no list initialized - ignoring\n", index);73 PRINTF(0)(" Critical: unable to add object to the list nr. %i: no list initialized - ignoring\n", index); 75 74 } 76 75 … … 82 81 BaseObject* obj = this->managedObjectList[index]->firstElement(); 83 82 this->managedObjectList[index]->remove(obj); 83 if( unlikely(obj == NULL)) 84 { 85 PRINTF(0)("Critical: there was no object anymore in the dead list! This could result in Segfaults\n"); 86 } 84 87 return obj; 85 88 } 86 89 else 87 PRINTF(0)(" Error: unable to get object from the list nr. %i: no elements initialized - ignoring\n", index); 90 PRINTF(0)(" Critical: unable to get object from the list nr. %i: no elements initialized - ignoring\n", index); 91 return NULL; 88 92 } 89 93
Note: See TracChangeset
for help on using the changeset viewer.