summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorGraham Madarasz (Graham) <graham@lindenlab.com>2013-03-08 15:31:37 -0800
committerGraham Madarasz (Graham) <graham@lindenlab.com>2013-03-08 15:31:37 -0800
commitf061b2b90e34d74b9c6db3606babb0402473a24d (patch)
treefeae72bd1acefaa7437250035ec0c32be02c731c /indra/newview/llvoavatar.cpp
parent4b67d34c7e31e7dcc8185061e4a0b02c5da6560a (diff)
Optimize interp code to elim hundreds of divides per frame and fix jitter bugs.
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-xindra/newview/llvoavatar.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 4efd59685e..d28da507ea 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2913,7 +2913,7 @@ void LLVOAvatar::idleUpdateWindEffect()
LLVector3 velocity = getVelocity();
F32 speed = velocity.length();
//RN: velocity varies too much frame to frame for this to work
- mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(0.02f));
+ mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(InterpDeltaTeenier));
mLastVel = velocity;
LLVector4 wind;
wind.setVec(getRegion()->mWind.getVelocityNoisy(getPositionAgent(), 4.f) - velocity);
@@ -2934,13 +2934,10 @@ void LLVOAvatar::idleUpdateWindEffect()
wind.mV[VW] = llmin(0.025f + (speed * 0.015f) + hover_strength, 0.5f);
F32 interp;
- if (wind.mV[VW] > mWindVec.mV[VW])
+ interp = LLCriticalDamp::getInterpolant(InterpDeltaSmall);
+ if (wind.mV[VW] <= mWindVec.mV[VW])
{
- interp = LLCriticalDamp::getInterpolant(0.2f);
- }
- else
- {
- interp = LLCriticalDamp::getInterpolant(0.4f);
+ interp *= 2.0f;
}
mWindVec = lerp(mWindVec, wind, interp);
@@ -3801,7 +3798,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
// Set the root rotation, but do so incrementally so that it
// lags in time by some fixed amount.
- //F32 u = LLCriticalDamp::getInterpolant(PELVIS_LAG);
F32 pelvis_lag_time = 0.f;
if (self_in_mouselook)
{