fix SkaManager issue

pull/21/head
greye 13 years ago
parent 783e81afc3
commit 575244bd35

@ -31,8 +31,6 @@ namespace MWRender
mCameraNode->attachObject(mCamera);
mCameraNode->setPosition(0.f, 0.f, mHeight);
mPlayerNode->setVisible(false);
mPreviewCam.yaw = 0.f;
mPreviewCam.offset = 600.f;
}
@ -142,12 +140,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);
}
mPlayerNode->setVisible(!mFirstPersonView, false);
}
void Player::allowVanityMode(bool allow)
@ -173,7 +170,7 @@ namespace MWRender
float offset = 300.f;
Ogre::Vector3 rot(0.f, 0.f, 0.f);
if (mVanity.enabled) {
mPlayerNode->setVisible(true);
mPlayerNode->setVisible(true, false);
rot.x = Ogre::Degree(-30.f).valueRadians();
mMainCam.offset = mCamera->getPosition().z;
@ -183,9 +180,7 @@ namespace MWRender
offset = mMainCam.offset;
moveCameraNode(mPlayerNode);
}
if (offset == 0.f) {
mPlayerNode->setVisible(false);
mPlayerNode->setVisible(!mFirstPersonView, false);
}
rot.z = getYaw();
mCamera->setPosition(0.f, 0.f, offset);
@ -202,7 +197,7 @@ namespace MWRender
mPreviewMode = enable;
float offset = mCamera->getPosition().z;
if (mPreviewMode) {
mPlayerNode->setVisible(true);
mPlayerNode->setVisible(true, false);
mMainCam.offset = offset;
offset = mPreviewCam.offset;
@ -212,9 +207,7 @@ namespace MWRender
offset = mMainCam.offset;
moveCameraNode(mPlayerNode);
}
if (offset == 0.f) {
mPlayerNode->setVisible(false);
mPlayerNode->setVisible(!mFirstPersonView, false);
}
mCamera->setPosition(0.f, 0.f, offset);
rotateCamera(Ogre::Vector3(getPitch(), 0.f, getYaw()), false);
@ -300,6 +293,12 @@ namespace MWRender
}
}
void Player::setAnimation(NpcAnimation *anim)
{
mAnimation = anim;
mPlayerNode->setVisible(!mFirstPersonView, false);
}
void Player::setHeight(float height)
{
mHeight = height;

@ -86,9 +86,7 @@ namespace MWRender
void setCameraDistance(float dist, bool adjust = false);
void setAnimation(MWRender::NpcAnimation *anim) {
mAnimation = anim;
}
void setAnimation(MWRender::NpcAnimation *anim);
void setHeight(float height);
float getHeight();

@ -405,6 +405,8 @@ void SkyManager::update(float duration)
{
if (!mEnabled) return;
mRootNode->setPosition(mCamera->getPosition());
// UV Scroll the clouds
mCloudAnimationTimer += duration * mCloudSpeed * (MWBase::Environment::get().getWorld()->getTimeScaleFactor()/30.f);
sh::Factory::getInstance().setSharedParameter ("cloudAnimationTimer",

Loading…
Cancel
Save