Changeset 8582 for code/branches/presentation/src/orxonox
- Timestamp:
- May 25, 2011, 10:10:09 PM (14 years ago)
- Location:
- code/branches/presentation/src/orxonox/worldentities/pawns
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
r8580 r8582 79 79 this->registerVariables(); 80 80 81 Camera* camera = CameraManager::getInstance().getActiveCamera();82 this->cameraOriginal Position_ = camera->getPosition();83 this->cameraOriginalOrientation_ = camera->getOrientation();81 this->cameraOriginalPosition_ = Vector3::UNIT_SCALE; 82 this->cameraOriginalOrientation_ = Quaternion::IDENTITY; 83 84 84 85 85 this->shakeFrequency_ = 15; … … 182 182 } 183 183 184 shakeCamera(dt);184 this->shakeCamera(dt); 185 185 } 186 186 } … … 242 242 //COUT(0) << "Boost startet!\n"; 243 243 this->bBoost_ = true; 244 Camera* camera = CameraManager::getInstance().getActiveCamera(); 245 this->cameraOriginalPosition_ = camera->getPosition(); 246 this->cameraOriginalOrientation_ = camera->getOrientation(); 244 247 } 245 248 if(!bBoost) … … 273 276 274 277 //COUT(0) << "Angle: " << angle << std::endl; 275 Camera* c = this->getCamera();278 Camera* camera = this->getCamera(); 276 279 277 280 //Shaking Camera effect 278 if (c != 0)279 { 280 c ->setOrientation(Vector3::UNIT_X, angle);281 } 282 } 283 } 284 281 if (camera != 0) 282 { 283 camera->setOrientation(Vector3::UNIT_X, angle); 284 } 285 } 286 } 287 285 288 void SpaceShip::resetCamera() 286 289 { 287 288 //COUT(0) << "Resetting camera\n"; 289 Camera *c = this->getCamera(); 290 291 if (c == 0) 290 Camera *camera = this->getCamera(); 291 292 if (camera == 0) 292 293 { 293 294 COUT(2) << "Failed to reset camera!"; … … 295 296 } 296 297 297 shakeDt_ = 0; 298 // 299 c->setPosition(this->cameraOriginalPosition_); 300 c->setOrientation(this->cameraOriginalOrientation_); 298 this->shakeDt_ = 0; 299 camera->setPosition(this->cameraOriginalPosition_); 300 camera->setOrientation(this->cameraOriginalOrientation_); 301 } 302 303 void SpaceShip::backupCamera() 304 { 305 Camera* camera = CameraManager::getInstance().getActiveCamera(); 306 if(camera != NULL) 307 { 308 this->cameraOriginalPosition_ = camera->getPosition(); 309 this->cameraOriginalOrientation_ = camera->getOrientation(); 310 } 301 311 } 302 312 -
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h
r8580 r8582 108 108 109 109 void resetCamera(); 110 void backupCamera(); 110 111 void shakeCamera(float dt); 111 112
Note: See TracChangeset
for help on using the changeset viewer.