summaryrefslogtreecommitdiff
path: root/indra/newview/llagentcamera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagentcamera.cpp')
-rw-r--r--indra/newview/llagentcamera.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index a40d9cd318..9025c7af8b 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -179,7 +179,7 @@ LLAgentCamera::LLAgentCamera() :
clearGeneralKeys();
clearOrbitKeys();
- clearPanKeys();
+ clearPanKeys();
}
// Requires gSavedSettings to be initialized.
@@ -192,9 +192,6 @@ void LLAgentCamera::init()
mDrawDistance = gSavedSettings.getF32("RenderFarClip");
- const F32 SMOOTHING_HALF_LIFE = 0.02f;
- LLCriticalDamp::setInterpolantConstant(InterpDeltaCameraSmoothingHalfLife, gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE);
-
LLViewerCamera::getInstance()->setView(DEFAULT_FIELD_OF_VIEW);
// Leave at 0.1 meters until we have real near clip management
LLViewerCamera::getInstance()->setNear(0.1f);
@@ -340,7 +337,7 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera)
LLVector3 agent_at_axis = gAgent.getAtAxis();
agent_at_axis -= projected_vec(agent_at_axis, gAgent.getReferenceUpVector());
agent_at_axis.normalize();
- gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(InterpDeltaSmall)));
+ gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(0.3f)));
}
setFocusOnAvatar(TRUE, ANIMATE);
@@ -1249,7 +1246,7 @@ void LLAgentCamera::updateCamera()
gAgentCamera.clearPanKeys();
// lerp camera focus offset
- mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(InterpDeltaCameraFocusHalfLife));
+ mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE));
if ( mCameraMode == CAMERA_MODE_FOLLOW )
{
@@ -1364,8 +1361,10 @@ void LLAgentCamera::updateCamera()
mCameraSmoothingStop = mCameraSmoothingStop || in_build_mode;
if (cameraThirdPerson() && !mCameraSmoothingStop)
- {
- F32 smoothing = LLCriticalDamp::getInterpolant(InterpDeltaCameraSmoothingHalfLife);
+ {
+ const F32 SMOOTHING_HALF_LIFE = 0.02f;
+
+ F32 smoothing = LLCriticalDamp::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE);
if (!mFocusObject) // we differentiate on avatar mode
{
@@ -1395,7 +1394,7 @@ void LLAgentCamera::updateCamera()
}
- mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(InterpDeltaFovZoomHalfLife));
+ mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE));
// llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl;
@@ -1810,7 +1809,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
if (mTargetCameraDistance != mCurrentCameraDistance)
{
- F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaCameraZoomHalfLife);
+ F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(CAMERA_ZOOM_HALF_LIFE);
mCurrentCameraDistance = lerp(mCurrentCameraDistance, mTargetCameraDistance, camera_lerp_amt);
}
@@ -1828,7 +1827,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
if (isAgentAvatarValid())
{
LLVector3d camera_lag_d;
- F32 lag_interp = LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife);
+ F32 lag_interp = LLCriticalDamp::getInterpolant(CAMERA_LAG_HALF_LIFE);
LLVector3 target_lag;
LLVector3 vel = gAgent.getVelocity();
@@ -1873,7 +1872,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
}
else
{
- mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife));
+ mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(0.15f));
}
camera_lag_d.setVec(mCameraLag);