diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 0d75325d8..5c79a4d26 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1316,55 +1316,6 @@ namespace MWRender return mTerrain->getHeightAt(pos); } - bool RenderingManager::vanityRotateCamera(const float *rot) - { - if(!mCamera->isVanityOrPreviewModeEnabled()) - return false; - - mCamera->rotateCamera(rot[0], rot[2], true); - return true; - } - - void RenderingManager::resetCamera() - { - mCamera->reset(); - } - - float RenderingManager::getCameraDistance() const - { - return mCamera->getCameraDistance(); - } - - Camera* RenderingManager::getCamera() - { - return mCamera.get(); - } - - const osg::Vec3f &RenderingManager::getCameraPosition() const - { - return mCurrentCameraPos; - } - - void RenderingManager::togglePOV(bool force) - { - mCamera->toggleViewMode(force); - } - - void RenderingManager::togglePreviewMode(bool enable) - { - mCamera->togglePreviewMode(enable); - } - - bool RenderingManager::toggleVanityMode(bool enable) - { - return mCamera->toggleVanityMode(enable); - } - - void RenderingManager::allowVanityMode(bool allow) - { - mCamera->allowVanityMode(allow); - } - void RenderingManager::overrideFieldOfView(float val) { if (mFieldOfViewOverridden != true || mFieldOfViewOverride != val) diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index c0b8f4293..1f6f25ace 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -209,15 +209,8 @@ namespace MWRender float getTerrainHeightAt(const osg::Vec3f& pos); // camera stuff - bool vanityRotateCamera(const float *rot); - void resetCamera(); - float getCameraDistance() const; - Camera* getCamera(); - const osg::Vec3f& getCameraPosition() const; - void togglePOV(bool force = false); - void togglePreviewMode(bool enable); - bool toggleVanityMode(bool enable); - void allowVanityMode(bool allow); + Camera* getCamera() { return mCamera.get(); } + const osg::Vec3f& getCameraPosition() const { return mCurrentCameraPos; } /// temporarily override the field of view with given value. void overrideFieldOfView(float val); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index b617183b9..50242d7bd 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -225,7 +225,7 @@ namespace MWWorld setupPlayer(); renderPlayer(); - mRendering->resetCamera(); + mRendering->getCamera()->reset(); // we don't want old weather to persist on a new game // Note that if reset later, the initial ChangeWeather that the chargen script calls will be lost. @@ -1953,7 +1953,7 @@ namespace MWWorld MWWorld::Ptr World::getFacedObject(float maxDistance, bool ignorePlayer) { - const float camDist = mRendering->getCameraDistance(); + const float camDist = mRendering->getCamera()->getCameraDistance(); maxDistance += camDist; MWWorld::Ptr facedObject; MWRender::RenderingManager::RayResult rayToObject; @@ -2356,7 +2356,7 @@ namespace MWWorld void World::togglePOV(bool force) { - mRendering->togglePOV(force); + mRendering->getCamera()->toggleViewMode(force); } bool World::isFirstPerson() const @@ -2371,12 +2371,12 @@ namespace MWWorld void World::togglePreviewMode(bool enable) { - mRendering->togglePreviewMode(enable); + mRendering->getCamera()->togglePreviewMode(enable); } bool World::toggleVanityMode(bool enable) { - return mRendering->toggleVanityMode(enable); + return mRendering->getCamera()->toggleVanityMode(enable); } void World::disableDeferredPreviewRotation() @@ -2391,12 +2391,16 @@ namespace MWWorld void World::allowVanityMode(bool allow) { - mRendering->allowVanityMode(allow); + mRendering->getCamera()->allowVanityMode(allow); } bool World::vanityRotateCamera(float * rot) { - return mRendering->vanityRotateCamera(rot); + if(!mRendering->getCamera()->isVanityOrPreviewModeEnabled()) + return false; + + mRendering->getCamera()->rotateCamera(rot[0], rot[2], true); + return true; } void World::adjustCameraDistance(float dist)