mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 12:23:51 +00:00
Remove camera stuff from RenderingManager
This commit is contained in:
parent
694e0b5906
commit
e9b2e9b474
3 changed files with 13 additions and 65 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue