Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 26, 2011, 5:00:17 PM (13 years ago)
Author:
landauf
Message:

some changes related to camera switching:

  • added ViewportEventListener (currently only listens to camera changes in a viewport)
  • Shader now correctly updates its visibility if the camera changes the scene
  • (the same lines of code also fix the weird Ogre behavior which was originally fixed in CameraManager)
  • GraphicsManager also updates the GUIManager's camera
  • if all cameras are destroyed, CameraManager now officially switches to NULL camera
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/libraries/core/GraphicsManager.cc

    r7874 r7966  
    5757#include "Game.h"
    5858#include "GameMode.h"
     59#include "GUIManager.h"
    5960#include "Loader.h"
    6061#include "MemoryArchive.h"
    6162#include "PathConfig.h"
     63#include "ViewportEventListener.h"
    6264#include "WindowEventListener.h"
    6365#include "XMLFile.h"
     
    381383    void GraphicsManager::setCamera(Ogre::Camera* camera)
    382384    {
     385        Ogre::Camera* oldCamera = this->viewport_->getCamera();
     386
    383387        this->viewport_->setCamera(camera);
     388        GUIManager::getInstance().setCamera(camera);
     389
     390        for (ObjectList<ViewportEventListener>::iterator it = ObjectList<ViewportEventListener>::begin(); it != ObjectList<ViewportEventListener>::end(); ++it)
     391            it->cameraChanged(this->viewport_, oldCamera);
    384392    }
    385393
Note: See TracChangeset for help on using the changeset viewer.