From 225a3984cb95dee598d6cd175f0de199fbd71740 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Thu, 13 Sep 2012 12:22:09 -0700 Subject: MAINT-1561: BUGFIX Another target omega fix for an issue detected with a clock pendulum. --- indra/newview/llviewerobject.cpp | 14 +++++++++++--- indra/newview/llviewerobject.h | 1 + 2 files changed, 12 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); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 83e34dc6ca..fbf6361ffb 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -734,6 +734,7 @@ protected: F32 mTimeDilation; // Time dilation sent with the object. F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega) LLQuaternion mAngularVelocityRot; // accumulated rotation from the angular velocity computations + LLQuaternion mPreviousRotation; LLVOJointInfo* mJointInfo; U8 mState; // legacy -- cgit v1.2.3 From 9e166b6291698e230ee5ca6f84e91151b3edc61b Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Fri, 14 Sep 2012 14:36:28 -0700 Subject: tag merge of DRTVWR-215 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index eeb6f5360c..8dcc4b8943 100644 --- a/.hgtags +++ b/.hgtags @@ -304,3 +304,4 @@ b1dbb1a83f48f93f6f878cff9e52d2cb635e145c 3.4.0-beta2 af7b28e75bd5a629cd9e0dc46fb3f1757626f493 DRTVWR-212 015012c2b740ccdec8a8c3d6e5f898449ecfe0b8 DRTVWR-213 62b07aa81b1957897c3846292bb9412977b0af6c 3.3.4-beta6 +ceed0b65a69f1eac20d523e0203320a32f9a3f3c DRTVWR-215 -- cgit v1.2.3 From 29aace5692da95c3937368b8f33b9c88112acbed Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Fri, 14 Sep 2012 14:38:56 -0700 Subject: Added tag 3.4.0-beta7 for changeset 733ceac77583 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 8dcc4b8943..cce68f4b6a 100644 --- a/.hgtags +++ b/.hgtags @@ -305,3 +305,4 @@ af7b28e75bd5a629cd9e0dc46fb3f1757626f493 DRTVWR-212 015012c2b740ccdec8a8c3d6e5f898449ecfe0b8 DRTVWR-213 62b07aa81b1957897c3846292bb9412977b0af6c 3.3.4-beta6 ceed0b65a69f1eac20d523e0203320a32f9a3f3c DRTVWR-215 +733ceac77583874f3626ef7a15c105b83ef0f5bb 3.4.0-beta7 -- cgit v1.2.3