mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 20:36:42 +00:00
Camera can pull out after clearing obstruction instead of instant snapback.
This commit is contained in:
parent
a890c951bc
commit
8ac143c983
2 changed files with 8 additions and 0 deletions
|
@ -62,6 +62,7 @@ namespace MWRender
|
||||||
mVanityToggleQueuedValue(false),
|
mVanityToggleQueuedValue(false),
|
||||||
mViewModeToggleQueued(false),
|
mViewModeToggleQueued(false),
|
||||||
mCameraDistance(0.f),
|
mCameraDistance(0.f),
|
||||||
|
mMaxNextCameraDistance(800.f),
|
||||||
mFocalPointCurrentOffset(osg::Vec2d()),
|
mFocalPointCurrentOffset(osg::Vec2d()),
|
||||||
mFocalPointTargetOffset(osg::Vec2d()),
|
mFocalPointTargetOffset(osg::Vec2d()),
|
||||||
mFocalPointTransitionSpeedCoef(1.f),
|
mFocalPointTransitionSpeedCoef(1.f),
|
||||||
|
@ -221,6 +222,8 @@ namespace MWRender
|
||||||
float speed = mTrackingPtr.getClass().getSpeed(mTrackingPtr);
|
float speed = mTrackingPtr.getClass().getSpeed(mTrackingPtr);
|
||||||
float maxDelta = 300.f * duration;
|
float maxDelta = 300.f * duration;
|
||||||
mSmoothedSpeed += osg::clampBetween(speed - mSmoothedSpeed, -maxDelta, maxDelta);
|
mSmoothedSpeed += osg::clampBetween(speed - mSmoothedSpeed, -maxDelta, maxDelta);
|
||||||
|
|
||||||
|
mMaxNextCameraDistance = mCameraDistance + duration * (100.f + mBaseCameraDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::setFocalPointTargetOffset(osg::Vec2d v)
|
void Camera::setFocalPointTargetOffset(osg::Vec2d v)
|
||||||
|
@ -472,7 +475,11 @@ namespace MWRender
|
||||||
if (mVanity.enabled || mPreviewMode)
|
if (mVanity.enabled || mPreviewMode)
|
||||||
mCameraDistance = mPreviewCam.offset;
|
mCameraDistance = mPreviewCam.offset;
|
||||||
else if (!mFirstPersonView)
|
else if (!mFirstPersonView)
|
||||||
|
{
|
||||||
mCameraDistance = mBaseCameraDistance + getCameraDistanceCorrection();
|
mCameraDistance = mBaseCameraDistance + getCameraDistanceCorrection();
|
||||||
|
if (mDynamicCameraDistanceEnabled)
|
||||||
|
mCameraDistance = std::min(mCameraDistance, mMaxNextCameraDistance);
|
||||||
|
}
|
||||||
mFocalPointAdjustment = osg::Vec3d();
|
mFocalPointAdjustment = osg::Vec3d();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ namespace MWRender
|
||||||
bool mViewModeToggleQueued;
|
bool mViewModeToggleQueued;
|
||||||
|
|
||||||
float mCameraDistance;
|
float mCameraDistance;
|
||||||
|
float mMaxNextCameraDistance;
|
||||||
|
|
||||||
osg::Vec3d mFocalPointAdjustment;
|
osg::Vec3d mFocalPointAdjustment;
|
||||||
osg::Vec2d mFocalPointCurrentOffset;
|
osg::Vec2d mFocalPointCurrentOffset;
|
||||||
|
|
Loading…
Reference in a new issue