mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 03:23:54 +00:00
Fix camera shaking when near the pitch limit.
This commit is contained in:
parent
ff1d908af4
commit
755a80a522
1 changed files with 4 additions and 3 deletions
|
@ -242,14 +242,15 @@ namespace MWRender
|
||||||
|
|
||||||
void Player::setPitch(float angle)
|
void Player::setPitch(float angle)
|
||||||
{
|
{
|
||||||
float limit = Ogre::Math::HALF_PI;
|
const float epsilon = 0.000001;
|
||||||
|
float limit = Ogre::Math::HALF_PI - epsilon;
|
||||||
if (mVanity.forced || mPreviewMode) {
|
if (mVanity.forced || mPreviewMode) {
|
||||||
limit /= 2;
|
limit /= 2;
|
||||||
}
|
}
|
||||||
if (angle > limit) {
|
if (angle > limit) {
|
||||||
angle = limit - 0.01;
|
angle = limit;
|
||||||
} else if (angle < -limit) {
|
} else if (angle < -limit) {
|
||||||
angle = -limit + 0.01;
|
angle = -limit;
|
||||||
}
|
}
|
||||||
if (mVanity.enabled || mPreviewMode) {
|
if (mVanity.enabled || mPreviewMode) {
|
||||||
mPreviewCam.pitch = angle;
|
mPreviewCam.pitch = angle;
|
||||||
|
|
Loading…
Reference in a new issue