Changeset 5751 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Nov 24, 2005, 1:14:06 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.