summaryrefslogtreecommitdiff
path: root/indra/newview
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
parentaa90985d677dfea573216b1a3a58acaa3b866656 (diff)
SL-1481 Time limit should be per object
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewerobject.cpp14
-rw-r--r--indra/newview/llviewerobject.h1
2 files changed, 8 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
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 990c392531..8b1535851e 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -772,6 +772,7 @@ protected:
F64Seconds mLastInterpUpdateSecs; // Last update for purposes of interpolation
F64Seconds mLastMessageUpdateSecs; // Last update from a message from the simulator
TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator
+ F64SecondsImplicit mRegionCrossExpire; // frame time we detected region crossing in + wait time
// extra data sent from the sim...currently only used for tree species info
U8* mData;