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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gameimmersion/src/orxonox/graphics/Camera.cc

    r8079 r8138  
    4848    CreateFactory(Camera);
    4949
    50     Camera::Camera(BaseObject* creator) : StaticEntity(creator)
     50    //Camera::Camera(BaseObject* creator) : StaticEntity(creator)
     51    Camera::Camera(BaseObject* creator) : MovableEntity(creator)
    5152    {
    5253        RegisterObject(Camera);
  • code/branches/gameimmersion/src/orxonox/graphics/Camera.h

    r8079 r8138  
    3636#include "tools/interfaces/Tickable.h"
    3737#include "tools/interfaces/TimeFactorListener.h"
    38 #include "worldentities/StaticEntity.h"
     38//#include "worldentities/StaticEntity.h"
     39#include "worldentities/MovableEntity.h"
    3940
    4041namespace orxonox
    4142{
    42     class _OrxonoxExport Camera : public StaticEntity, public Tickable, public TimeFactorListener, public WindowEventListener
     43    //class _OrxonoxExport Camera : public StaticEntity, public Tickable, public TimeFactorListener, public WindowEventListener
     44    class _OrxonoxExport Camera : public MovableEntity, public TimeFactorListener, public WindowEventListener
    4345    {
    4446        friend class CameraManager;
  • 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.