Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 12, 2011, 11:37:25 AM (13 years ago)
Author:
landauf
Message:

fixed a few issues related to the free mouse look mode (default CTRL key):

  • cursor is now moved to the center of the screen after leaving the mouse look mode
  • spaceship doesn't spin anymore after leaving the mode
  • camera doesn't drag back to the original position after leaving the mode, but jumps back immediately
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/worldentities/ControllableEntity.cc

    r7857 r7860  
    4040#include "Scene.h"
    4141#include "infos/PlayerInfo.h"
    42 #include "controllers/Controller.h"
     42#include "controllers/NewHumanController.h"
    4343#include "graphics/Camera.h"
    4444#include "worldentities/CameraPosition.h"
     
    204204                this->currentCameraPosition_ = 0;
    205205            }
    206            
     206
    207207            // disable mouse look if the new camera position doesn't allow it
    208208            if (this->currentCameraPosition_ && !this->currentCameraPosition_->getAllowMouseLook() && this->bMouseLook_)
    209209                this->mouseLook();
     210
     211            // disable drag if in mouse look
     212            if (this->bMouseLook_)
     213                this->getCamera()->setDrag(false);
    210214        }
    211215    }
     
    219223
    220224            if (!this->bMouseLook_)
     225            {
    221226                this->cameraPositionRootNode_->setOrientation(Quaternion::IDENTITY);
     227                this->cameraPositionRootNode_->_update(true, false); // update the camera node because otherwise the camera will drag back in position which looks strange
     228
     229                NewHumanController* controller = dynamic_cast<NewHumanController*>(this->getController());
     230                if (controller)
     231                    controller->centerCursor();
     232            }
     233
    222234            if (this->getCamera())
    223235            {
Note: See TracChangeset for help on using the changeset viewer.