fix 1st/preview/1st change; 1st invisible model

pull/21/head
greye 13 years ago
parent 392e6efcb5
commit 783e81afc3

@ -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);
}

@ -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);

Loading…
Cancel
Save