summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-09-13 12:22:09 -0700
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-09-13 12:22:09 -0700
commit225a3984cb95dee598d6cd175f0de199fbd71740 (patch)
tree7fab3c06875eb8e6556a2f2c9c2cc6ca8d9259a5 /indra/newview/llviewerobject.cpp
parent094dc91d0dae4971f6ae89840d791466a6fd6d08 (diff)
MAINT-1561: BUGFIX Another target omega fix for an issue detected with a clock pendulum.
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 0a6c51b378..97783d843e 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -236,6 +236,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mTimeDilation(1.f),
mRotTime(0.f),
mAngularVelocityRot(),
+ mPreviousRotation(),
mJointInfo(NULL),
mState(0),
mMedia(NULL),
@@ -2072,10 +2073,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
}
}
- if (new_rot != getRotation()
- || new_angv != old_angv)
+ if ((new_rot != getRotation())
+ || (new_angv != old_angv))
{
- if (new_angv != old_angv)
+ if (new_rot != mPreviousRotation)
+ {
+ resetRot();
+ }
+ else if (new_angv != old_angv)
{
if (flagUsePhysics() || new_angv.isExactlyZero())
{
@@ -2087,6 +2092,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
}
}
+ // Remember the last rotation value
+ mPreviousRotation = new_rot;
+
// Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega)
setRotation(new_rot * mAngularVelocityRot);
setChanged(ROTATED | SILHOUETTE);