Changeset 9077 in orxonox.OLD for branches/presentation/src/world_entities
- Timestamp:
- Jul 4, 2006, 12:28:22 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/space_ships/spacecraft_2d.cc
r9075 r9077 371 371 this->velocity += (accelerationDir - damping)* dt; 372 372 this->shiftCoor (this->velocity * dt); 373 374 // limit the maximum rotation speed. 375 if (this->rotation != 0.0f) 376 { 377 float maxRot = 10.0 * dt; 378 if (unlikely(this->rotation > maxRot)) this->rotation = maxRot; 379 if (unlikely(this->rotation < -maxRot)) this->rotation = -maxRot; 380 this->direction *= Quaternion(-M_PI/4.0*this->rotation, Vector(0,1,0)); 381 382 this->rotation = 0.0f; 383 } 384 385 this->setRelDirSoft(this->direction, 5); 373 this->setRelDirSoft(Quaternion(0, Vector(0,0,0)), 1.0f); 386 374 } 387 375 break; … … 415 403 else if( event.type == EV_MOUSE_MOTION) 416 404 { 417 float xMouse, yMouse; 418 xMouse = event.xRel*mouseSensitivity; 419 yMouse = event.yRel*mouseSensitivity; 420 421 // rotate the Player around the y-axis 422 this->rotation += xMouse; 423 424 this->cameraLook += yMouse; 425 // rotate the Camera around the z-axis 426 if (cameraLook > M_PI_4) 427 cameraLook = M_PI_4; 428 else if (cameraLook < -M_PI_4) 429 cameraLook = -M_PI_4; 430 //this->cameraNode.setRelDirSoft(this->direction,10); 431 } 432 } 405 406 407 408 if (this->getPlaymode() == Playable::Full3D) 409 { 410 float xMouse, yMouse; 411 xMouse = event.xRel*mouseSensitivity; 412 yMouse = event.yRel*mouseSensitivity; 413 414 // rotate the Player around the y-axis 415 this->rotation += xMouse; 416 417 this->cameraLook += yMouse; 418 // rotate the Camera around the z-axis 419 if (cameraLook > M_PI_4) 420 cameraLook = M_PI_4; 421 else if (cameraLook < -M_PI_4) 422 cameraLook = -M_PI_4; 423 //this->cameraNode.setRelDirSoft(this->direction,10); 424 } 425 } 426 }
Note: See TracChangeset
for help on using the changeset viewer.