@@ -1195,34 +1195,34 @@ void W3DView::update(void)
11951195 {
11961196 Real desiredHeight = (m_terrainHeightUnderCamera + m_heightAboveGround);
11971197 Real desiredZoom = desiredHeight / m_cameraOffset.z ;
1198+
11981199 if (didScriptedMovement || (TheGameLogic->isInReplayGame () && TheGlobalData->m_useCameraInReplay ))
11991200 {
12001201 // if we are in a scripted camera movement, take its height above ground as our desired height.
12011202 m_heightAboveGround = m_currentHeightAboveGround;
12021203 // DEBUG_LOG(("Frame %d: height above ground: %g %g %g %g", TheGameLogic->getFrame(), m_heightAboveGround,
12031204 // m_cameraOffset.z, m_zoom, m_terrainHeightUnderCamera));
12041205 }
1206+
12051207 if (TheInGameUI->isScrolling ())
12061208 {
12071209 // if scrolling, only adjust if we're too close or too far
12081210 if (m_scrollAmount.length () < m_scrollAmountCutoff || (m_currentHeightAboveGround < m_minHeightAboveGround) || (TheGlobalData->m_enforceMaxCameraHeight && m_currentHeightAboveGround > m_maxHeightAboveGround))
12091211 {
1210- Real zoomAdj = (desiredZoom - m_zoom)* TheGlobalData->m_cameraAdjustSpeed ;
1211- if (fabs (zoomAdj) >= 0.0001 ) // only do positive
1212+ Real zoomAdj = (desiredZoom - m_zoom) * TheGlobalData->m_cameraAdjustSpeed * TheGameEngine-> getActualLogicTimeScaleOverFpsRatio () ;
1213+ if (fabs (zoomAdj) >= 0 .0001f ) // only do positive
12121214 {
12131215 m_zoom += zoomAdj;
12141216 recalcCamera = true ;
12151217 }
12161218 }
12171219 }
1218- else
1220+ else if (!didScriptedMovement)
12191221 {
12201222 // we're not scrolling; settle toward desired height above ground
1221- Real zoomAdj = (m_zoom - desiredZoom)*TheGlobalData->m_cameraAdjustSpeed ;
1222- Real zoomAdjAbs = fabs (zoomAdj);
1223- if (zoomAdjAbs >= 0.0001 && !didScriptedMovement)
1223+ Real zoomAdj = (m_zoom - desiredZoom) * TheGlobalData->m_cameraAdjustSpeed * TheGameEngine->getActualLogicTimeScaleOverFpsRatio ();
1224+ if (fabs (zoomAdj) >= 0 .0001f )
12241225 {
1225- // DEBUG_LOG(("W3DView::update() - m_zoom=%g, desiredHeight=%g", m_zoom, desiredZoom));
12261226 m_zoom -= zoomAdj;
12271227 recalcCamera = true ;
12281228 }
0 commit comments