mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Use a method to check if the view should be first person
This commit is contained in:
parent
bb8277920b
commit
dbba126344
2 changed files with 11 additions and 8 deletions
|
@ -104,8 +104,8 @@ namespace MWRender
|
|||
void Player::toggleViewMode()
|
||||
{
|
||||
mFirstPersonView = !mFirstPersonView;
|
||||
mAnimation->setViewMode((mVanity.enabled || mPreviewMode || !mFirstPersonView) ?
|
||||
NpcAnimation::VM_Normal : NpcAnimation::VM_FirstPerson);
|
||||
mAnimation->setViewMode(isFirstPerson() ? NpcAnimation::VM_FirstPerson :
|
||||
NpcAnimation::VM_Normal);
|
||||
if (mFirstPersonView) {
|
||||
mCamera->setPosition(0.f, 0.f, 0.f);
|
||||
setLowHeight(false);
|
||||
|
@ -131,8 +131,8 @@ namespace MWRender
|
|||
return true;
|
||||
mVanity.enabled = enable;
|
||||
|
||||
mAnimation->setViewMode((mVanity.enabled || mPreviewMode || !mFirstPersonView) ?
|
||||
NpcAnimation::VM_Normal : NpcAnimation::VM_FirstPerson);
|
||||
mAnimation->setViewMode(isFirstPerson() ? NpcAnimation::VM_FirstPerson :
|
||||
NpcAnimation::VM_Normal);
|
||||
|
||||
float offset = mPreviewCam.offset;
|
||||
Ogre::Vector3 rot(0.f, 0.f, 0.f);
|
||||
|
@ -161,8 +161,8 @@ namespace MWRender
|
|||
return;
|
||||
|
||||
mPreviewMode = enable;
|
||||
mAnimation->setViewMode((mVanity.enabled || mPreviewMode || !mFirstPersonView) ?
|
||||
NpcAnimation::VM_Normal : NpcAnimation::VM_FirstPerson);
|
||||
mAnimation->setViewMode(isFirstPerson() ? NpcAnimation::VM_FirstPerson :
|
||||
NpcAnimation::VM_Normal);
|
||||
|
||||
float offset = mCamera->getPosition().z;
|
||||
if (mPreviewMode) {
|
||||
|
@ -277,8 +277,8 @@ namespace MWRender
|
|||
if(mAnimation && mAnimation != anim)
|
||||
mAnimation->setViewMode(NpcAnimation::VM_Normal);
|
||||
mAnimation = anim;
|
||||
mAnimation->setViewMode((mVanity.enabled || mPreviewMode || !mFirstPersonView) ?
|
||||
NpcAnimation::VM_Normal : NpcAnimation::VM_FirstPerson);
|
||||
mAnimation->setViewMode(isFirstPerson() ? NpcAnimation::VM_FirstPerson :
|
||||
NpcAnimation::VM_Normal);
|
||||
}
|
||||
|
||||
void Player::setHeight(float height)
|
||||
|
|
|
@ -76,6 +76,9 @@ namespace MWRender
|
|||
|
||||
void togglePreviewMode(bool enable);
|
||||
|
||||
bool isFirstPerson() const
|
||||
{ return !(mVanity.enabled || mPreviewMode || !mFirstPersonView); }
|
||||
|
||||
void update(float duration);
|
||||
|
||||
/// Set camera distance for current mode. Don't work on 1st person view.
|
||||
|
|
Loading…
Reference in a new issue