diff options
author | Richard Linden <none@none> | 2013-08-21 14:06:57 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-08-21 14:06:57 -0700 |
commit | 2c6bc5afa59a88136fd6de4ebf0cb99ea7cdef3f (patch) | |
tree | c91e15225fc14b0ea753d8188199f8e7f806e7a5 /indra/newview/llviewerobject.cpp | |
parent | 6d9af374066421a1d8465a57795250a1614adcbb (diff) |
SH-4433 WIP Interesting: Statistics > Ping Sim is always 0 ms
made getPrimaryAccumulator return a reference since it was an
always non-null pointer
changed unit conversion to perform lazy division in order to avoid truncation
of timer values
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 8092eda7b2..9235f23a8c 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2439,7 +2439,7 @@ void LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) // Move an object due to idle-time viewer side updates by interpolating motion -void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& time, const F32SecondsImplicit& dt) +void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& time, const F32SecondsImplicit& dt_seconds) { // linear motion // PHYSICS_TIMESTEP is used below to correct for the fact that the velocity in object @@ -2450,8 +2450,9 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& time, con // to see if object is selected, instead of explicitly // zeroing it out + F32 dt = dt_seconds; F64Seconds time_since_last_update = time - mLastMessageUpdateSecs; - if (time_since_last_update <= (F64Seconds)0.0 || dt <= (F32Seconds)0.f) + if (time_since_last_update <= (F64Seconds)0.0 || dt <= 0.f) { return; } @@ -2463,7 +2464,7 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& time, con { // Old code path ... unbounded, simple interpolation if (!(accel.isExactlyZero() && vel.isExactlyZero())) { - LLVector3 pos = (vel + (0.5f * (dt-PHYSICS_TIMESTEP)) * accel) * dt.value(); + LLVector3 pos = (vel + (0.5f * (dt-PHYSICS_TIMESTEP)) * accel) * dt; // region local setPositionRegion(pos + getPositionRegion()); @@ -2477,7 +2478,7 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& time, con { // Object is moving, and hasn't been too long since we got an update from the server // Calculate predicted position and velocity - LLVector3 new_pos = (vel + (0.5f * (dt-PHYSICS_TIMESTEP)) * accel) * dt.value(); + LLVector3 new_pos = (vel + (0.5f * (dt-PHYSICS_TIMESTEP)) * accel) * dt; LLVector3 new_v = accel * dt; if (time_since_last_update > sPhaseOutUpdateInterpolationTime && |