Changeset 5483 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Nov 4, 2005, 1:51:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/player.cc
r5482 r5483 286 286 if( this->bDown && this->getRelCoor().x > -5) 287 287 accel = accel -(direction*acceleration); 288 if( this->bLeft) 289 { 290 if( TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2) 288 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2) 291 289 accel = accel - (orthDirection*acceleration); 292 else 293 this->setRelDirSoft(Quaternion(0, Vector(1,0,0)), 5); 294 } 295 if( this->bRight) 296 { 297 if (TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2) 298 accel = accel + (orthDirection*acceleration); 299 else 300 this->setRelDirSoft(Quaternion(0, Vector(1,0,0)), 5); 301 } 290 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2) 291 accel = accel + (orthDirection*acceleration); 302 292 if( this->bAscend ) { /* FIXME */ } 303 293 if( this->bDescend) {/* FIXME */} /* @todo up and down player movement */ 304 294 305 295 Vector move = accel * time; 296 297 if (accel.z < 0) 298 this->setRelDirSoft(Quaternion(-.4, Vector(1,0,0)), 5); 299 else if (accel.z > 0) 300 this->setRelDirSoft(Quaternion(.4, Vector(1,0,0)), 5); 301 else 302 this->setRelDirSoft(Quaternion(0, Vector(1,0,0)), 5); 306 303 this->shiftCoor (move); 307 304 } … … 329 326 this->bDown = event.bPressed; 330 327 else if( event.type == KeyMapper::PEV_RIGHT) 331 {332 328 this->bRight= event.bPressed; 333 if (event.bPressed)334 this->setRelDirSoft(Quaternion(.4, Vector(1,0,0)), 5);335 else336 this->setRelDirSoft(Quaternion(0, Vector(1,0,0)), 5);337 }338 329 else if( event.type == KeyMapper::PEV_LEFT) 339 {340 330 this->bLeft = event.bPressed; 341 if (event.bPressed)342 this->setRelDirSoft(Quaternion(-.4, Vector(1,0,0)), 5);343 else344 this->setRelDirSoft(Quaternion(0, Vector(1,0,0)), 5);345 }346 331 else if( event.type == KeyMapper::PEV_FIRE1) 347 332 this->bFire = event.bPressed;
Note: See TracChangeset
for help on using the changeset viewer.