diff --git a/apps/openmw/mwrender/player.cpp b/apps/openmw/mwrender/player.cpp index c20ffad55d..4a6ce03702 100644 --- a/apps/openmw/mwrender/player.cpp +++ b/apps/openmw/mwrender/player.cpp @@ -31,6 +31,8 @@ namespace MWRender mCameraNode->attachObject(mCamera); mCameraNode->setPosition(0.f, 0.f, mHeight); + mPlayerNode->setVisible(false); + mPreviewCam.yaw = 0.f; mPreviewCam.offset = 600.f; } @@ -140,9 +142,11 @@ namespace MWRender if (mFirstPersonView) { mCamera->setPosition(0.f, 0.f, 0.f); mCameraNode->setPosition(0.f, 0.f, 128.f); + mPlayerNode->setVisible(false); } else { mCamera->setPosition(0.f, 0.f, mCameraDistance); mCameraNode->setPosition(0.f, 0.f, 104.f); + mPlayerNode->setVisible(true); } } @@ -169,6 +173,7 @@ namespace MWRender float offset = 300.f; Ogre::Vector3 rot(0.f, 0.f, 0.f); if (mVanity.enabled) { + mPlayerNode->setVisible(true); rot.x = Ogre::Degree(-30.f).valueRadians(); mMainCam.offset = mCamera->getPosition().z; @@ -179,6 +184,9 @@ namespace MWRender moveCameraNode(mPlayerNode); } + if (offset == 0.f) { + mPlayerNode->setVisible(false); + } rot.z = getYaw(); mCamera->setPosition(0.f, 0.f, offset); rotateCamera(rot, false); @@ -194,6 +202,7 @@ namespace MWRender mPreviewMode = enable; float offset = mCamera->getPosition().z; if (mPreviewMode) { + mPlayerNode->setVisible(true); mMainCam.offset = offset; offset = mPreviewCam.offset; @@ -204,7 +213,10 @@ namespace MWRender moveCameraNode(mPlayerNode); } - mCamera->setPosition(0.f, 0.f, mPreviewCam.offset); + if (offset == 0.f) { + mPlayerNode->setVisible(false); + } + mCamera->setPosition(0.f, 0.f, offset); rotateCamera(Ogre::Vector3(getPitch(), 0.f, getYaw()), false); } diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 8b6f483ca7..87faba3e79 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -131,10 +131,10 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const SceneNode *rt = mRendering.getScene()->getRootSceneNode(); mMwRoot = rt->createChildSceneNode(); mMwRoot->pitch(Degree(-90)); + mObjects.setMwRoot(mMwRoot); mActors.setMwRoot(mMwRoot); - Ogre::SceneNode *playerNode = mMwRoot->createChildSceneNode ("player"); mPlayer = new MWRender::Player (mRendering.getCamera(), playerNode);