From 430f9420cf0094635b0b0428a29ff7dfaf5718e8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 7 Jun 2018 22:18:15 +0100 Subject: SL-915 - more on dynamic extent tracking, possible fix for 32-bit crash issues --- indra/newview/llvoavatar.cpp | 61 ++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 28 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 93e470e0fb..8c3a180570 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -671,7 +671,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mCachedInMuteList(false), mIsControlAvatar(false), mIsUIAvatar(false), - mEnableDefaultMotions(true) + mEnableDefaultMotions(true), + mRiggingInfoNeedsUpdate(true) { LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; @@ -1279,8 +1280,12 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) } } +static LLTrace::BlockTimerStatHandle FTM_AVATAR_EXTENT_UPDATE("Avatar Update Extent"); + void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { + LL_RECORD_BLOCK_TIME(FTM_AVATAR_EXTENT_UPDATE); + S32 box_detail = gSavedSettings.getS32("AvatarBoundingBoxComplexity"); LLVector4a buffer(0.0); LLVector4a pos; @@ -1364,7 +1369,13 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) // Stretch bounding box by rigged mesh joint boxes if (box_detail>=3) { - updateRiggingInfo(); + // AXON try to cache unless something has changed about attached rigged meshes. + // Needs more logic based on volume states. + //if (mRiggingInfoNeedsUpdate) + { + updateRiggingInfo(); + mRiggingInfoNeedsUpdate = false; + } for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) { LLJoint *joint = getJoint(joint_num); @@ -5854,8 +5865,6 @@ void LLVOAvatar::clearAttachmentOverrides() { LLScopedContextString str("clearAttachmentOverrides " + getFullname()); - mActiveOverrideMeshes.clear(); - for (S32 i=0; i=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; if ( fullRig && !mesh_overrides_loaded ) { - mActiveOverrideMeshes.insert(mesh_id); - for ( int i=0; imJointNames[i].c_str(); @@ -6174,6 +6184,8 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::setupdateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, attached_object->mJointRiggingInfoTab); + mJointRiggingInfoTab.merge(attached_object->mJointRiggingInfoTab); //LL_INFOS() << "after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; @@ -9504,7 +9504,7 @@ void LLVOAvatar::updateRiggingInfo() { LLViewerObject *childp = *it; childp->updateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, childp->mJointRiggingInfoTab); + mJointRiggingInfoTab.merge(childp->mJointRiggingInfoTab); //LL_INFOS() << "after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; } } @@ -9515,9 +9515,8 @@ void LLVOAvatar::updateRiggingInfo() LLVOVolume *volp = control_av->mRootVolp; if (volp && !volp->isAttachment()) { - volp->updateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, volp->mJointRiggingInfoTab); - LL_DEBUGS("RigSpammish") << getFullname() << " after cav update rig tab:" << LL_ENDL; + mJointRiggingInfoTab.merge(volp->mJointRiggingInfoTab); + LL_DEBUGS("RigSpammish") << getFullname() << " mRootVolp " << control_av->mRootVolp << " after cav update rig tab:" << LL_ENDL; S32 joint_count, box_count; showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count); LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; @@ -9529,7 +9528,7 @@ void LLVOAvatar::updateRiggingInfo() { LLViewerObject *childp = *it; childp->updateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, childp->mJointRiggingInfoTab); + mJointRiggingInfoTab.merge(childp->mJointRiggingInfoTab); LL_DEBUGS("RigSpammish") << getFullname() << " after cav child update rig tab:" << LL_ENDL; S32 joint_count, box_count; @@ -9547,6 +9546,12 @@ void LLVOAvatar::updateRiggingInfo() LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; } +// virtual +void LLVOAvatar::onActiveOverrideMeshesChanged() +{ + mRiggingInfoNeedsUpdate = true; +} + U32 LLVOAvatar::getPartitionType() const { // Avatars merely exist as drawables in the bridge partition -- cgit v1.3