diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index fc8192f14b454f6a526be3eafeee5a9b9650fbc1..bbbf071570b4aeb9c184bb7844c1bcfe130738a2 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) { - resetRot(); + resetRotTime(); } // Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega) @@ -5547,9 +5547,14 @@ void LLViewerObject::applyAngularVelocity(F32 dt) } } -void LLViewerObject::resetRot() +void LLViewerObject::resetRotTime() { mRotTime = 0.0f; +} + +void LLViewerObject::resetRot() +{ + resetRotTime(); // Reset the accumulated angular velocity rotation mAngularVelocityRot.loadIdentity(); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 530d6531f3f50dd9659e607b4d4eb5d2cd8de95b..05d017dee3a6160bb3fe6b652cf0b20363691b5e 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -212,6 +212,9 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate virtual BOOL updateLOD(); virtual BOOL setDrawableParent(LLDrawable* parentp); F32 getRotTime() { return mRotTime; } +private: + void resetRotTime(); +public: void resetRot(); void applyAngularVelocity(F32 dt); @@ -224,7 +227,7 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate LLViewerRegion* getRegion() const { return mRegionp; } BOOL isSelected() const { return mUserSelected; } - virtual void setSelected(BOOL sel) { mUserSelected = sel; mRotTime = 0.f;} + virtual void setSelected(BOOL sel) { mUserSelected = sel; resetRot();} const LLUUID &getID() const { return mID; } U32 getLocalID() const { return mLocalID; }