|
|
|
@ -66,6 +66,7 @@ namespace MWRender
|
|
|
|
|
mFocalPointCurrentOffset(osg::Vec2d()),
|
|
|
|
|
mFocalPointTargetOffset(osg::Vec2d()),
|
|
|
|
|
mFocalPointTransitionSpeedCoef(1.f),
|
|
|
|
|
mSkipFocalPointTransition(true),
|
|
|
|
|
mPreviousTransitionInfluence(0.f),
|
|
|
|
|
mSmoothedSpeed(0.f),
|
|
|
|
|
mZoomOutWhenMoveCoef(Settings::Manager::getFloat("zoom out when move coef", "Camera")),
|
|
|
|
@ -220,6 +221,7 @@ namespace MWRender
|
|
|
|
|
updateFocalPointOffset(duration);
|
|
|
|
|
|
|
|
|
|
float speed = mTrackingPtr.getClass().getSpeed(mTrackingPtr);
|
|
|
|
|
speed /= (1.f + speed / 500.f);
|
|
|
|
|
float maxDelta = 300.f * duration;
|
|
|
|
|
mSmoothedSpeed += osg::clampBetween(speed - mSmoothedSpeed, -maxDelta, maxDelta);
|
|
|
|
|
|
|
|
|
@ -238,6 +240,14 @@ namespace MWRender
|
|
|
|
|
if (duration <= 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (mSkipFocalPointTransition)
|
|
|
|
|
{
|
|
|
|
|
mSkipFocalPointTransition = false;
|
|
|
|
|
mPreviousExtraOffset = osg::Vec2d();
|
|
|
|
|
mPreviousTransitionInfluence = 0.f;
|
|
|
|
|
mFocalPointCurrentOffset = mFocalPointTargetOffset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
osg::Vec2d oldOffset = mFocalPointCurrentOffset;
|
|
|
|
|
|
|
|
|
|
if (mPreviousTransitionInfluence > 0)
|
|
|
|
|