- Timestamp:
- Nov 24, 2005, 1:14:06 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/campaign.cc
r5671 r5751 91 91 return; 92 92 93 const TiXmlElement* element = root->FirstChildElement(); 94 // load Worlds/Subcampaigns/Whatever 95 StoryEntity* lastCreated = NULL; 96 while( element != NULL) 93 LOAD_PARAM_START_CYCLE(root, element); 97 94 { 98 95 PRINTF(5)("Campaign: Constructor: adding a world\n"); 99 96 StoryEntity* created = (StoryEntity*) GameLoader::getInstance()->fabricate(element); 100 /*101 if( lastCreated != NULL)102 created->setNextStoryID( lastCreated->getStoryID());103 else104 created->setNextStoryID( WORLD_ID_GAMEEND);105 */106 97 if( created != NULL) 107 98 { 108 99 this->addEntity( created); 109 lastCreated = created; 110 } 111 element = element->NextSiblingElement(); 100 } 112 101 } 102 LOAD_PARAM_END_CYCLE(element); 113 103 } 114 104 -
trunk/src/story_entities/world.cc
r5750 r5751 371 371 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON); 372 372 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON); 373 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, SDLK_PAGEUP); 374 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, SDLK_PAGEDOWN); 373 375 374 376 // bind camera -
trunk/src/world_entities/camera.cc
r5384 r5751 167 167 this->setParentSoft("TrackNode"); 168 168 this->target->setParentSoft("TrackNode"); 169 this->setRelCoorSoft(Vector( 0, 10, 0));170 this->target->setRelCoorSoft( 0,0,0);169 this->setRelCoorSoft(Vector(30, 50, 0)); 170 this->target->setRelCoorSoft(35,0,0); 171 171 } 172 172 } -
trunk/src/world_entities/player.cc
r5750 r5751 273 273 { 274 274 Vector accel(0.0, 0.0, 0.0); 275 Vector rot(0.0, 0.0, 0.0); 276 float rotVal = 0.0; 275 277 /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */ 276 278 /* calculate the direction in which the craft is heading */ … … 281 283 282 284 if( this->bUp && this->getRelCoor().x < 20) 283 accel = accel+(direction*acceleration);285 accel += direction; 284 286 if( this->bDown && this->getRelCoor().x > -5) 285 accel = accel -(direction*acceleration); 287 accel -= direction; 288 286 289 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2) 287 accel = accel - (orthDirection*acceleration); 290 { 291 accel -=(orthDirection); 292 rot +=Vector(1,0,0); 293 rotVal -= .4; 294 } 288 295 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2) 289 accel = accel + (orthDirection*acceleration); 296 { 297 accel += orthDirection; 298 rot += Vector(1,0,0); 299 rotVal += .4; 300 } 301 if (this->bAscend ) 302 { 303 accel += Vector(0,1,0); 304 rot += Vector(0,0,1); 305 rotVal += .4; 306 } 307 if (this->bDescend ) 308 { 309 accel -= Vector(0,1,0); 310 rot += Vector(0,0,1); 311 rotVal -= .4; 312 } 313 290 314 if( this->bAscend ) { /* FIXME */ } 291 315 if( this->bDescend) {/* FIXME */} /* @todo up and down player movement */ 292 316 293 Vector move = accel * time ;294 295 if (accel.z < 0)296 this->setRelDirSoft(Quaternion(-.4, Vector(1,0,0)), 5);317 Vector move = accel * time *acceleration; 318 319 /* if (accel.z < 0) 320 this->setRelDirSoft(Quaternion(-.4, accel), 5); 297 321 else if (accel.z > 0) 298 this->setRelDirSoft(Quaternion(.4, Vector(1,0,0)), 5); 299 else 300 this->setRelDirSoft(Quaternion(0, Vector(1,0,0)), 5); 322 this->setRelDirSoft(Quaternion(.4, accel), 5); 323 else*/ 324 rot.normalize(); 325 this->setRelDirSoft(Quaternion(rotVal, rot), 5); 301 326 this->shiftCoor (move); 302 327 } … … 333 358 else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed) 334 359 this->weaponMan->previousWeaponConfig(); 360 361 else if( event.type == SDLK_PAGEUP) 362 this->bAscend = event.bPressed; //this->shiftCoor(0,.1,0); 363 else if( event.type == SDLK_PAGEDOWN) 364 this->bDescend = event.bPressed; //this->shiftCoor(0,-.1,0); 335 365 } 336 366
Note: See TracChangeset
for help on using the changeset viewer.