summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-12-13 00:10:52 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-12-13 00:10:52 +0200
commit80054757ed0eee816c253a7707576252b7e89d9e (patch)
tree3a4810a6dcb80d4b64dd6ca19270b93fe0f3cd41 /indra/newview/llviewerobject.cpp
parentaa90985d677dfea573216b1a3a58acaa3b866656 (diff)
SL-1481 Time limit should be per object
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 079a9f0372..007adf2a72 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -261,6 +261,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mLastInterpUpdateSecs(0.f),
mLastMessageUpdateSecs(0.f),
mLatestRecvPacketID(0),
+ mRegionCrossExpire(0),
mData(NULL),
mAudioSourcep(NULL),
mAudioGain(1.f),
@@ -2636,8 +2637,7 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim
new_pos.mV[VZ] = llmax(min_height, new_pos.mV[VZ]);
// Check to see if it's going off the region
- LLVector3 temp(new_pos);
- static F64SecondsImplicit region_cross_expire = 0; // frame time we detected region crossing in + wait time
+ LLVector3 temp(new_pos.mV[VX], new_pos.mV[VY], 0.f);
if (temp.clamp(0.f, mRegionp->getWidth()))
{ // Going off this region, so see if we might end up on another region
LLVector3d old_pos_global = mRegionp->getPosGlobalFromRegion(getPositionRegion());
@@ -2664,28 +2664,28 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim
// Note: theoretically we can find time from velocity, acceleration and
// distance from border to new position, but it is not going to work
// if 'phase_out' activates
- if (region_cross_expire == 0)
+ if (mRegionCrossExpire == 0)
{
// Workaround: we can't accurately figure out time when we cross border
// so just write down time 'after the fact', it is far from optimal in
// case of lags, but for lags sMaxUpdateInterpolationTime will kick in first
LL_DEBUGS("Interpolate") << "Predicted region crossing, new position " << new_pos << LL_ENDL;
- region_cross_expire = frame_time + sMaxRegionCrossingInterpolationTime;
+ mRegionCrossExpire = frame_time + sMaxRegionCrossingInterpolationTime;
}
- else if (frame_time > region_cross_expire)
+ else if (frame_time > mRegionCrossExpire)
{
// Predicting crossing over 1s, stop motion
// Stop motion
LL_DEBUGS("Interpolate") << "Predicting region crossing for too long, stopping at " << new_pos << LL_ENDL;
new_v.clear();
setAcceleration(LLVector3::zero);
- region_cross_expire = 0;
+ mRegionCrossExpire = 0;
}
}
}
else
{
- region_cross_expire = 0;
+ mRegionCrossExpire = 0;
}
// Set new position and velocity