Merge remote-tracking branch 'kolek/thirdpersonzoom'

actorid
Marc Zinnschlag 12 years ago
commit a8168c58c2

@ -327,6 +327,7 @@ namespace MWBase
virtual void togglePlayerLooking(bool enable) = 0;
virtual void changeVanityModeScale(float factor) = 0;
virtual bool vanityRotateCamera(float * rot) = 0;
virtual void setCameraDistance(float dist, bool adjust = false, bool override = true)=0;
virtual void setupPlayer() = 0;
virtual void renderPlayer() = 0;

@ -588,7 +588,10 @@ namespace MWInput
}
if (arg.zrel)
{
MWBase::Environment::get().getWorld()->changeVanityModeScale(arg.zrel);
MWBase::Environment::get().getWorld()->setCameraDistance(arg.zrel, true, true);
}
}
return true;

@ -327,7 +327,6 @@ void RenderingManager::update (float duration, bool paused)
Ogre::Vector3 playerPos(_playerPos[0], _playerPos[1], _playerPos[2]);
Ogre::Vector3 orig, dest;
mCamera->setCameraDistance();
if(!mCamera->getPosition(orig, dest))
{
orig.z += mCamera->getHeight() * mRootNode->getScale().z;
@ -902,6 +901,14 @@ bool RenderingManager::vanityRotateCamera(const float *rot)
return true;
}
void RenderingManager::setCameraDistance(float dist, bool adjust, bool override)
{
if(!mCamera->isVanityOrPreviewModeEnabled() && !mCamera->isFirstPerson())
{
mCamera->setCameraDistance(-dist / 120.f * 10, adjust, override);
}
}
void RenderingManager::getInteriorMapPosition (Ogre::Vector2 position, float& nX, float& nY, int &x, int& y)
{
return mLocalMap->getInteriorMapPosition (position, nX, nY, x, y);

@ -86,6 +86,7 @@ public:
void resetCamera();
bool vanityRotateCamera(const float *rot);
void setCameraDistance(float dist, bool adjust = false, bool override = true);
void setupPlayer(const MWWorld::Ptr &ptr);
void renderPlayer(const MWWorld::Ptr &ptr);

@ -1576,6 +1576,11 @@ namespace MWWorld
return mRendering->vanityRotateCamera(rot);
}
void World::setCameraDistance(float dist, bool adjust, bool override)
{
return mRendering->setCameraDistance(dist, adjust, override);;
}
void World::setupPlayer()
{
const ESM::NPC *player = mStore.get<ESM::NPC>().find("player");

@ -376,6 +376,7 @@ namespace MWWorld
}
virtual bool vanityRotateCamera(float * rot);
virtual void setCameraDistance(float dist, bool adjust = false, bool override = true);
virtual void setupPlayer();
virtual void renderPlayer();

Loading…
Cancel
Save