Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 28, 2011, 3:13:04 PM (14 years ago)
Author:
dboehi
Message:

First version of the camera shake effect for the afterburner

Location:
code/branches/gameimmersion/src/orxonox/worldentities/pawns
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gameimmersion/src/orxonox/worldentities/pawns/SpaceShip.cc

    r7860 r8138  
    3636#include "core/XMLPort.h"
    3737#include "items/Engine.h"
     38#include "graphics/Camera.h"
     39#include "CameraManager.h"
    3840
    3941namespace orxonox
     
    7678        this->setConfigValues();
    7779        this->registerVariables();
     80       
     81        Camera* c = CameraManager::getInstance().getActiveCamera();
     82        this->cameraOriginalPosition = c->getPosition();
     83        this->cameraOriginalOrientation = c->getOrientation();
    7884    }
    7985
     
    152158            if(this->bBoost_)
    153159            {
     160                Camera* c = CameraManager::getInstance().getActiveCamera();
    154161                this->boostPower_ -=this->boostRate_*dt;
    155162                if(this->boostPower_ <= 0.0f)
     
    158165                    this->bBoostCooldown_ = true;
    159166                    this->timer_.setTimer(this->boostCooldownDuration_, false, createExecutor(createFunctor(&SpaceShip::boostCooledDown, this)));
     167                   
     168                    c->setVelocity(0,0,0);
     169                    c->setPosition(this->cameraOriginalPosition);
     170                    c->setOrientation(this->cameraOriginalOrientation);
    160171                }
     172                else
     173                {
     174                        //Kamera schuettelt
     175                        COUT(1) << "Afterburner effect\n";
     176                        if (c != 0)
     177                        {
     178                                c->setVelocity(0.1, 2.0, 0.3);
     179                        }
     180                }
    161181            }
    162182        }
  • code/branches/gameimmersion/src/orxonox/worldentities/pawns/SpaceShip.h

    r7801 r8138  
    114114            Engine* engine_;
    115115            Timer timer_;
     116            Vector3 cameraOriginalPosition;
     117            Quaternion cameraOriginalOrientation;
    116118    };
    117119}
Note: See TracChangeset for help on using the changeset viewer.