diff options
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9e2999e521..db1f9ac11a 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -249,7 +249,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mOnMap(FALSE), mStatic(FALSE), mNumFaces(0), - mTimeDilation(1.f), mRotTime(0.f), mAngularVelocityRot(), mPreviousRotation(), @@ -1103,12 +1102,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, return retval; } + F32 time_dilation = 1.f; if(mesgsys != NULL) { U16 time_dilation16; mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16); - F32 time_dilation = ((F32) time_dilation16) / 65535.f; - mTimeDilation = time_dilation; + time_dilation = ((F32) time_dilation16) / 65535.f; mRegionp->setTimeDilation(time_dilation); } @@ -1889,7 +1888,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, { U32 flags; mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, block_num); - loadFlags(flags); + loadFlags(flags); } } break; @@ -2192,7 +2191,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender()); if (cdp) { - F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay().valueInUnits<LLUnits::Seconds>()) + gFrameDTClamped); + F32 ping_delay = 0.5f * time_dilation * ( ((F32)cdp->getPingDelay().valueInUnits<LLUnits::Seconds>()) + gFrameDTClamped); LLVector3 diff = getVelocity() * ping_delay; new_pos_parent += diff; } @@ -2407,35 +2406,34 @@ void LLViewerObject::loadFlags(U32 flags) return; } -void LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLViewerObject::idleUpdate(LLAgent &agent, const F64 &time) { //static LLTrace::BlockTimerStatHandle ftm("Viewer Object"); //LL_RECORD_BLOCK_TIME(ftm); if (!mDead) { - // CRO - don't velocity interp linked objects! - // Leviathan - but DO velocity interp joints - if (!mStatic && sVelocityInterpolate && !isSelected()) - { - // calculate dt from last update - F32 dt_raw = ((F64Seconds)time - mLastInterpUpdateSecs).value(); - F32 dt = mTimeDilation * dt_raw; + if (!mStatic && sVelocityInterpolate && !isSelected()) + { + // calculate dt from last update + F32 time_dilation = mRegionp ? mRegionp->getTimeDilation() : 1.0f; + F32 dt_raw = ((F64Seconds)time - mLastInterpUpdateSecs).value(); + F32 dt = time_dilation * dt_raw; applyAngularVelocity(dt); if (isAttachment()) - { - mLastInterpUpdateSecs = (F64Seconds)time; + { + mLastInterpUpdateSecs = (F64Seconds)time; return; + } + else + { // Move object based on it's velocity and rotation + interpolateLinearMotion(time, dt); + } } - else - { // Move object based on it's velocity and rotation - interpolateLinearMotion(time, dt); - } - } - updateDrawable(FALSE); + updateDrawable(FALSE); } } |