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