diff options
author | andreykproductengine <akleshchev@productengine.com> | 2014-09-30 20:02:33 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2014-09-30 20:02:33 +0300 |
commit | caaa711c6a4e56795b1fd08f0585cedba3e4212c (patch) | |
tree | ba48d037229553daf1a8f065788d7cdf1cc48bad | |
parent | 1edf45f33b52b2f7e86d0e9b58fa7373e4870f5a (diff) |
MAINT-4448 FIXED Avatar often stops animating when being animated by an intan solo dance ball on Interesting based viewers only.
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 16 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.h | 2 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 9 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 1 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 8 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.h | 1 |
6 files changed, 31 insertions, 6 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7a6637c0a1..7d82ecf565 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -66,6 +66,7 @@ #include "llviewerstatsrecorder.h" #include "llvlmanager.h" #include "llvlcomposition.h" +#include "llvoavatarself.h" #include "llvocache.h" #include "llworld.h" #include "llspatialpartition.h" @@ -1485,22 +1486,27 @@ void LLViewerRegion::killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& if(drawablep && !drawablep->getParent()) { - if (drawablep->getVObj()->isSelected()) + LLViewerObject* v_obj = drawablep->getVObj(); + if (v_obj->isSelected() + || (v_obj->flagAnimSource() && isAgentAvatarValid() && gAgentAvatarp->hasMotionFromSource(v_obj->getID()))) { - // do not remove selected objects + // do not remove objects user is interacting with ((LLViewerOctreeEntryData*)drawablep)->setVisible(); return; } - LLViewerObject::const_child_list_t& child_list = drawablep->getVObj()->getChildren(); + LLViewerObject::const_child_list_t& child_list = v_obj->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); iter != child_list.end(); iter++) { LLViewerObject* child = *iter; if(child->mDrawable) { - if(!child->mDrawable->getEntry() || !child->mDrawable->getEntry()->hasVOCacheEntry() || child->isSelected()) + if( !child->mDrawable->getEntry() + || !child->mDrawable->getEntry()->hasVOCacheEntry() + || child->isSelected() + || (child->flagAnimSource() && isAgentAvatarValid() && gAgentAvatarp->hasMotionFromSource(child->getID()))) { - //do not remove parent if any of its children non-cacheable or selected + //do not remove parent if any of its children non-cacheable, animating or selected //especially for the case that an avatar sits on a cache-able object ((LLViewerOctreeEntryData*)drawablep)->setVisible(); return; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 1e225553b8..d01e746936 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -385,7 +385,7 @@ public: private: void addToVOCacheTree(LLVOCacheEntry* entry); LLViewerObject* addNewObject(LLVOCacheEntry* entry); - void killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& delete_list); + void killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& delete_list); //adds entry into list if it is safe to move into cache void removeFromVOCacheTree(LLVOCacheEntry* entry); void killCacheEntry(LLVOCacheEntry* entry, bool for_rendering = false); //physically delete the cache entry void killInvisibleObjects(F32 max_time); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 904d08ac73..dfb9bb54e7 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5017,6 +5017,15 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) } //----------------------------------------------------------------------------- +// hasMotionFromSource() +//----------------------------------------------------------------------------- +// virtual +bool LLVOAvatar::hasMotionFromSource(const LLUUID& source_id) +{ + return false; +} + +//----------------------------------------------------------------------------- // stopMotionFromSource() //----------------------------------------------------------------------------- // virtual diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 66a357ff62..4d5e616906 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -191,6 +191,7 @@ public: /*virtual*/ LLUUID remapMotionID(const LLUUID& id); /*virtual*/ BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); /*virtual*/ BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); + virtual bool hasMotionFromSource(const LLUUID& source_id); virtual void stopMotionFromSource(const LLUUID& source_id); virtual void requestStopMotion(LLMotion* motion); LLMotion* findMotion(const LLUUID& id) const; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 42a7c2e576..02494d5091 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -749,6 +749,13 @@ void LLVOAvatarSelf::requestStopMotion(LLMotion* motion) } // virtual +bool LLVOAvatarSelf::hasMotionFromSource(const LLUUID& source_id) +{ + AnimSourceIterator motion_it = mAnimationSources.find(source_id); + return motion_it != mAnimationSources.end(); +} + +// virtual void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id) { for (AnimSourceIterator motion_it = mAnimationSources.find(source_id); motion_it != mAnimationSources.end(); ) @@ -757,6 +764,7 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id) mAnimationSources.erase(motion_it++); } + LLViewerObject* object = gObjectList.findObject(source_id); if (object) { diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index e03de9fa0b..ad73dd89b7 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -82,6 +82,7 @@ public: // LLCharacter interface and related //-------------------------------------------------------------------- public: + /*virtual*/ bool hasMotionFromSource(const LLUUID& source_id); /*virtual*/ void stopMotionFromSource(const LLUUID& source_id); /*virtual*/ void requestStopMotion(LLMotion* motion); /*virtual*/ LLJoint* getJoint(const std::string &name); |