From fc09a016a0272558a89e21a0228157eec3ed62cd Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 27 Aug 2012 13:31:07 -0700 Subject: MAINT-1480: Clearing the angular velocity accummulation when the updated angular velocity is set to zero. --- indra/newview/llviewerobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6c4e70add0..437a078061 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2075,7 +2075,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, { if (new_angv != old_angv) { - if (flagUsePhysics()) + if (flagUsePhysics() || new_angv.isExactlyZero()) { resetRot(); } -- cgit v1.2.3 From 7d54c71aeb6f0829c3c8f8ee68d7b3d542d32b55 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Mon, 27 Aug 2012 19:26:58 -0700 Subject: MAINT-1480: Ensuring that the new angular velocity is remembered for later comparison to the previous angular velocity. --- indra/newview/llviewerobject.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 437a078061..9ad8e14510 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1434,9 +1434,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #else val = (U16 *) &data[count]; #endif - setAngularVelocity( U16_to_F32(val[VX], -size, size), - U16_to_F32(val[VY], -size, size), - U16_to_F32(val[VZ], -size, size)); + new_angv.set(U16_to_F32(val[VX], -size, size), + U16_to_F32(val[VY], -size, size), + U16_to_F32(val[VZ], -size, size)); + setAngularVelocity(new_angv); break; case 16: @@ -1460,9 +1461,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, new_rot.mQ[VZ] = U8_to_F32(data[11], -1.f, 1.f); new_rot.mQ[VW] = U8_to_F32(data[12], -1.f, 1.f); - setAngularVelocity( U8_to_F32(data[13], -size, size), - U8_to_F32(data[14], -size, size), - U8_to_F32(data[15], -size, size) ); + new_angv.set(U8_to_F32(data[13], -size, size), + U8_to_F32(data[14], -size, size), + U8_to_F32(data[15], -size, size)); + setAngularVelocity(new_angv); break; } @@ -1534,9 +1536,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, dp->unpackU16(val[VX], "AccX"); dp->unpackU16(val[VY], "AccY"); dp->unpackU16(val[VZ], "AccZ"); - setAngularVelocity( U16_to_F32(val[VX], -64.f, 64.f), - U16_to_F32(val[VY], -64.f, 64.f), - U16_to_F32(val[VZ], -64.f, 64.f)); + new_angv.set(U16_to_F32(val[VX], -64.f, 64.f), + U16_to_F32(val[VY], -64.f, 64.f), + U16_to_F32(val[VZ], -64.f, 64.f)); + setAngularVelocity(new_angv); } break; case OUT_FULL_COMPRESSED: @@ -1580,8 +1583,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (value & 0x80) { - dp->unpackVector3(vec, "Omega"); - setAngularVelocity(vec); + dp->unpackVector3(new_angv, "Omega"); + setAngularVelocity(new_angv); } if (value & 0x20) -- cgit v1.2.3 From a766e26db46c7c054bae1021470dbe365f2a3cb3 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Mon, 10 Sep 2012 10:37:02 -0700 Subject: Backing out the changes contributing to DRTVWR-167 and DRTVWR-179 from the repository. --- indra/newview/llviewerobject.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6c4e70add0..572003d2ce 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -199,7 +199,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mID(id), mLocalID(0), mTotalCRC(0), - mListIndex(-1), mTEImages(NULL), mGLName(0), mbCanSelect(TRUE), @@ -2180,8 +2179,8 @@ BOOL LLViewerObject::isActive() const BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - //static LLFastTimer::DeclareTimer ftm("Viewer Object"); - //LLFastTimer t(ftm); + static LLFastTimer::DeclareTimer ftm("Viewer Object"); + LLFastTimer t(ftm); if (mDead) { @@ -4182,7 +4181,7 @@ S32 LLViewerObject::setTETextureCore(const U8 te, const LLUUID& uuid, LLHost hos return retval; } - +//virtual void LLViewerObject::changeTEImage(S32 index, LLViewerTexture* new_image) { if(index < 0 || index >= getNumTEs()) @@ -4801,11 +4800,9 @@ void LLViewerObject::deleteParticleSource() // virtual void LLViewerObject::updateDrawable(BOOL force_damped) { - if (!isChanged(MOVED)) - { //most common case, having an empty if case here makes for better branch prediction - } - else if (mDrawable.notNull() && - !mDrawable->isState(LLDrawable::ON_MOVE_LIST)) + if (mDrawable.notNull() && + !mDrawable->isState(LLDrawable::ON_MOVE_LIST) && + isChanged(MOVED)) { BOOL damped_motion = !isChanged(SHIFTED) && // not shifted between regions this frame and... -- cgit v1.2.3 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 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') 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); -- cgit v1.2.3 From c2d0531a0ed2236addfd5377af65efbf745892ed Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 20 Sep 2012 09:56:36 -0400 Subject: reapply 71673401390a: MAINT-646 Knock out some extraneous performance timers --- indra/newview/llviewerobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 97783d843e..890528266d 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2190,8 +2190,8 @@ BOOL LLViewerObject::isActive() const BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - static LLFastTimer::DeclareTimer ftm("Viewer Object"); - LLFastTimer t(ftm); + //static LLFastTimer::DeclareTimer ftm("Viewer Object"); + //LLFastTimer t(ftm); if (mDead) { -- cgit v1.2.3 From b4c8a982fc863debe28407d4cc3519b111309725 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 20 Sep 2012 10:00:53 -0400 Subject: reapply fde2ac0276e2: MAINT-646 Get rid of a hotspot in LLViewerObjectList::update, fix for error in llpolymorph --- indra/newview/llviewerobject.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 890528266d..1447f133e6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -199,6 +199,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mID(id), mLocalID(0), mTotalCRC(0), + mListIndex(-1), mTEImages(NULL), mGLName(0), mbCanSelect(TRUE), @@ -4811,9 +4812,11 @@ void LLViewerObject::deleteParticleSource() // virtual void LLViewerObject::updateDrawable(BOOL force_damped) { - if (mDrawable.notNull() && - !mDrawable->isState(LLDrawable::ON_MOVE_LIST) && - isChanged(MOVED)) + if (!isChanged(MOVED)) + { //most common case, having an empty if case here makes for better branch prediction + } + else if (mDrawable.notNull() && + !mDrawable->isState(LLDrawable::ON_MOVE_LIST)) { BOOL damped_motion = !isChanged(SHIFTED) && // not shifted between regions this frame and... -- cgit v1.2.3