summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2010-11-08 16:34:14 -0800
committerDave SIMmONs <simon@lindenlab.com>2010-11-08 16:34:14 -0800
commitb90614a6e7a217271766231b70b26c13cd7a670f (patch)
tree042fd91a0f35404de446b04c28e24c17390e3f0e /indra
parent447dc782fd4d490387fd98e9fb41135038512767 (diff)
ER-290 : New motion prediction in the viewer has avatars settle a bit too deeply underground when the simulator is paused, also no angular velocity damping.
Put Z limit on AVs, but not regular objects nor stopping rotation. Reviewed by Kelly.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerobject.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index ded7fa0b67..1804fac1b3 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2222,6 +2222,10 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
{ // Past the time limit, so stop the object
phase_out = 0.0;
//llinfos << "Motion phase out to zero" << llendl;
+
+ // Kill angular motion as well. Note - not adding this due to paranoia
+ // about stopping rotation for llTargetOmega objects and not having it restart
+ // setAngularVelocity(LLVector3::zero);
}
else if (mLastInterpUpdateSecs - mLastMessageUpdateSecs > sPhaseOutUpdateInterpolationTime)
{ // Last update was already phased out a bit
@@ -2253,7 +2257,18 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
// Clamp interpolated position to minimum underground and maximum region height
LLVector3d new_pos_global = mRegionp->getPosGlobalFromRegion(new_pos);
- F32 min_height = LLWorld::getInstance()->getMinAllowedZ(this, new_pos_global);
+ F32 min_height;
+ if (isAvatar())
+ { // Make a better guess about AVs not going underground
+ min_height = LLWorld::getInstance()->resolveLandHeightGlobal(new_pos_global);
+ min_height += (0.5f * getScale().mV[VZ]);
+ }
+ else
+ { // This will put the object underground, but we can't tell if it will stop
+ // at ground level or not
+ min_height = LLWorld::getInstance()->getMinAllowedZ(this, new_pos_global);
+ }
+
new_pos.mV[VZ] = llmax(min_height, new_pos.mV[VZ]);
new_pos.mV[VZ] = llmin(LLWorld::getInstance()->getRegionMaxHeight(), new_pos.mV[VZ]);