Changeset 3606 in orxonox.OLD for orxonox/branches/levelloader/src
- Timestamp:
- Mar 18, 2005, 12:02:59 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/story_entities/world.cc
r3605 r3606 114 114 delete this->lightMan; 115 115 delete this->trackManager; 116 }117 116 if( this->worldName) delete this->worldName; 118 117 if( this->path) delete this->path; 118 } 119 119 120 120 /** … … 139 139 */ 140 140 ErrorMessage World::load() 141 { 142 <<<<<<< .working 143 141 { 144 142 PRINTF0("> Loading world: '%s'\n", getPath()); 145 143 … … 155 153 // load the campaign document 156 154 if( !XMLDoc->LoadFile()) 157 ======= 158 // BezierCurve* tmpCurve = new BezierCurve(); 159 if(this->debugWorldNr != -1) 160 { 161 // initializing Font 162 testFont = new FontSet(); 163 testFont->buildFont("../data/pictures/font.tga"); 164 165 // initializing the TrackManager 166 trackManager = TrackManager::getInstance(); 167 trackManager->addPoint(Vector(0,0,0)); 168 trackManager->addPoint(Vector(100, -40, 5)); 169 trackManager->addPoint(Vector(200,-40,-8)); 170 trackManager->addPoint(Vector(250, -35, -2)); 171 trackManager->addPoint(Vector(320,-33,-.55)); 172 trackManager->setDuration(1); 173 trackManager->setSavePoint(); 174 trackManager->addPoint(Vector(410, 0, 0)); 175 trackManager->addPoint(Vector(510, 20, -10)); 176 trackManager->addPoint(Vector(550, 20, -10)); 177 trackManager->addPoint(Vector(570, 20, -10)); 178 trackManager->setDuration(1); 179 180 int fork11, fork12; 181 trackManager->fork(2, &fork11, &fork12); 182 trackManager->workOn(fork11); 183 trackManager->addPoint(Vector(640, 25, -30)); 184 trackManager->addPoint(Vector(700, 40, -120)); 185 trackManager->addPoint(Vector(800, 50, -150)); 186 trackManager->addPoint(Vector(900, 60, -100)); 187 trackManager->addPoint(Vector(900, 60, -70)); 188 trackManager->addPoint(Vector(990, 65, -15)); 189 trackManager->addPoint(Vector(1050, 65, -10)); 190 trackManager->addPoint(Vector(1100, 65, -20)); 191 trackManager->setDuration(4); 192 193 trackManager->workOn(fork12); 194 trackManager->addPoint(Vector(640, 25, 20)); 195 trackManager->addPoint(Vector(670, 50, 120)); 196 trackManager->addPoint(Vector(700, 70, 80)); 197 trackManager->addPoint(Vector(800, 70, 65)); 198 trackManager->addPoint(Vector(850, 65, 65)); 199 trackManager->addPoint(Vector(920, 35, 40)); 200 trackManager->addPoint(Vector(945, 40, 40)); 201 trackManager->addPoint(Vector(970, 24, 40)); 202 trackManager->addPoint(Vector(1000, 40, -7)); 203 trackManager->setDuration(4); 204 205 206 trackManager->join(2, fork11, fork12); 207 208 trackManager->workOn(5); 209 trackManager->addPoint(Vector(1200, 60, -50)); 210 trackManager->addPoint(Vector(1300, 50, -50)); 211 trackManager->addPoint(Vector(1400, 40, -50)); 212 trackManager->addPoint(Vector(1500, 40, -60)); 213 trackManager->addPoint(Vector(1600, 35, -55)); 214 trackManager->addPoint(Vector(1700, 45, -40)); 215 trackManager->addPoint(Vector(1750, 60, -40)); 216 trackManager->addPoint(Vector(1770, 80, -40)); 217 trackManager->addPoint(Vector(1800, 100, -40)); 218 trackManager->setDuration(4); 219 220 trackManager->finalize(); 221 222 223 /*monitor progress*/ 224 this->glmis->step(); 225 226 // LIGHT initialisation 227 lightMan = LightManager::getInstance(); 228 lightMan->setAmbientColor(.1,.1,.1); 229 lightMan->addLight(); 230 // lightMan->setAttenuation(1.0, .01, 0.0); 231 // lightMan->setDiffuseColor(1,1,1); 232 // lightMan->addLight(1); 233 // lightMan->setPosition(20, 10, -20); 234 // lightMan->setDiffuseColor(0,0,0); 235 lightMan->debug(); 236 237 switch(this->debugWorldNr) 238 >>>>>>> .merge-right.r3604 239 { 240 <<<<<<< .working 155 156 { 241 157 // report an error 242 158 PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol()); … … 316 232 PRINTF0("Done loading Track\n"); 317 233 } 318 =======319 /*320 this loads the hard-coded debug world. this only for simplicity and will be321 removed by a reald world-loader, which interprets a world-file.322 if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and323 make whatever you want...324 */325 case DEBUG_WORLD_0:326 {327 lightMan->setPosition(-5.0, 10.0, -40.0);328 this->nullParent = NullParent::getInstance ();329 this->nullParent->setName ("NullParent");330 >>>>>>> .merge-right.r3604331 332 234 333 235 // free the XML data … … 360 262 this->localPlayer->addChild (this->localCamera); 361 263 362 <<<<<<< .working363 264 364 265 // stuff beyond this point remains to be loaded properly … … 366 267 /*monitor progress*/ 367 268 // this->glmis->step(); 368 ======= 369 //create helper for player 370 //HelperParent* hp = new HelperParent (); 371 /* the player has to be added to this helper */ 372 >>>>>>> .merge-right.r3604 373 374 <<<<<<< .working 375 ======= 376 // create a player 377 this->localPlayer = new Player (); 378 this->localPlayer->setName ("player"); 379 this->spawn (this->localPlayer); 380 /*monitor progress*/ 381 this->glmis->step(); 382 383 // bind input 384 Orxonox *orx = Orxonox::getInstance (); 385 orx->getLocalInput()->bind (this->localPlayer); 386 387 // bind camera 388 this->localCamera = new Camera(this); 389 this->localCamera->setName ("camera"); 390 this->localCamera->bind (this->localPlayer); 391 /*monitor progress*/ 392 this->glmis->step(); 393 394 >>>>>>> .merge-right.r3604 269 395 270 // Create SkySphere 396 271 this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg"); … … 404 279 // trackManager->setBindSlave(env); 405 280 406 <<<<<<< .working407 =======408 409 WorldEntity* env = new Environment();410 env->setName ("env");411 this->spawn(env);412 413 414 Vector* es = new Vector (10, 5, 0);415 Quaternion* qs = new Quaternion ();416 WorldEntity* pr = new Primitive(PSPHERE);417 pr->setName("primitive");418 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);419 420 421 /*monitor progress*/422 this->glmis->step();423 424 // trackManager->setBindSlave(env);425 PNode* tn = trackManager->getTrackNode();426 tn->addChild(this->localPlayer);427 428 //localCamera->setParent(TrackNode::getInstance());429 tn->addChild (this->localCamera);430 this->localPlayer->setMode(PNODE_ROTATE_AND_MOVE);431 //Vector* cameraOffset = new Vector (0, 5, -10);432 Vector* cameraOffset = new Vector (-10, 5, 0);433 this->localCamera->setRelCoor (cameraOffset);434 trackManager->condition(2, LEFTRIGHT, this->localPlayer);435 436 break;437 }438 case DEBUG_WORLD_1:439 {440 lightMan->setPosition(.0, .0, .0);441 lightMan->setAttenuation(1.0, .01, 0.0);442 lightMan->setSpecularColor(1,0,0);443 this->nullParent = NullParent::getInstance ();444 this->nullParent->setName ("NullParent");445 446 // create a player447 WorldEntity* myPlayer = new Player();448 myPlayer->setName ("player");449 this->spawn(myPlayer);450 this->localPlayer = myPlayer;451 452 // bind input453 Orxonox *orx = Orxonox::getInstance();454 orx->getLocalInput()->bind (myPlayer);455 456 // bind camera457 this->localCamera = new Camera (this);458 this->localCamera->setName ("camera");459 this->localCamera->bind (myPlayer);460 this->localPlayer->addChild (this->localCamera);461 462 // Create SkySphere463 skySphere = new Skysphere("../data/pictures/sky-replace.jpg");464 this->localPlayer->addChild(this->skySphere);465 466 Vector* es = new Vector (20, 0, 0);467 Quaternion* qs = new Quaternion ();468 WorldEntity* pr = new Primitive(PSPHERE);469 pr->setName("primitive");470 this->spawn(pr, this->localPlayer, es, qs, PNODE_ROTATE_AND_MOVE);471 472 lightMan->getLight(0)->setParent(trackManager->getTrackNode());473 break;474 }475 default:476 printf("World::load() - no world with ID %i found", this->debugWorldNr );477 }478 }479 else if(this->worldName != NULL)480 {481 482 }483 484 >>>>>>> .merge-right.r3604485 281 // initialize debug coord system 486 282 objectList = glGenLists(1);
Note: See TracChangeset
for help on using the changeset viewer.