From b2a06578187af5446b5e24379abc8764f0cd731f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 16 Jun 2017 16:03:06 +0100 Subject: SL-697 - global scale function for LLControlAvatar, to support arbitrary scaling of animated objects. Not currently used. --- indra/llcharacter/lljoint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcharacter/lljoint.cpp') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index a3d5679f65..89335a20f5 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -881,7 +881,7 @@ void LLJoint::setWorldRotation( const LLQuaternion& rot ) //-------------------------------------------------------------------- const LLVector3& LLJoint::getScale() { - return mXform.getScale(); + return mXform.getScale(); } //-------------------------------------------------------------------- -- cgit v1.3 From f954abd9dfbf8f7147e1f5b352c8eadc6a074555 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 20 Apr 2018 13:37:07 +0100 Subject: MAINT-8549, MAINT-8554 - improvements to animesh ARC, restrict joint position overrides to +/-5m --- indra/llcharacter/lljoint.cpp | 13 +++++++++++-- indra/newview/llcontrolavatar.cpp | 2 +- indra/newview/llvoavatar.h | 1 + indra/newview/llvovolume.cpp | 4 ++++ 4 files changed, 17 insertions(+), 3 deletions(-) (limited to 'indra/llcharacter/lljoint.cpp') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 89335a20f5..abc5a95c8d 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -435,6 +435,15 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh // return; //} + LLVector3 constrained_pos = LLVector3(llclamp(pos[0],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), + llclamp(pos[1],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), + llclamp(pos[2],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET)); + if (constrained_pos != pos) + { + LL_DEBUGS("Avatar") << "attachment pos override constrained to " + << constrained_pos << " was " << pos << LL_ENDL; + } + LLVector3 before_pos; LLUUID before_mesh_id; bool has_active_override_before = hasAttachmentPosOverride( before_pos, before_mesh_id ); @@ -446,7 +455,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh } m_posBeforeOverrides = getPosition(); } - m_attachmentPosOverrides.add(mesh_id,pos); + m_attachmentPosOverrides.add(mesh_id,constrained_pos); LLVector3 after_pos; LLUUID after_mesh_id; hasAttachmentPosOverride(after_pos, after_mesh_id); @@ -455,7 +464,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh active_override_changed = true; if (do_debug_joint(getName())) { - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << constrained_pos << LL_ENDL; } updatePos(av_info); } diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index a181d8be9a..e77c7615e9 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -294,7 +294,7 @@ void LLControlAvatar::updateDebugText() active_string.c_str(), (S32) isImpostor(), streaming_cost)); addDebugText(llformat("types %s lods %s", type_string.c_str(), lod_string.c_str())); addDebugText(llformat("tris %d (est %.1f, streaming %.1f), verts %d", total_tris, est_tris, est_streaming_tris, total_verts)); - addDebugText(llformat("pxarea %s", LLStringOps::getReadableNumber(getPixelArea()).c_str())); + addDebugText(llformat("pxarea %s rank %d", LLStringOps::getReadableNumber(getPixelArea()).c_str(), getVisibilityRank())); #if 0 std::string region_name = "no region"; if (mRootVolp->getRegion()) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f00f855160..cccf857eba 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -747,6 +747,7 @@ private: public: BOOL isVisible() const; void setVisibilityRank(U32 rank); + U32 getVisibilityRank() const { return mVisibilityRank; } static S32 sNumVisibleAvatars; // Number of instances of this class /** Appearance ** ** diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ba733f9387..bf646eb44b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3932,6 +3932,10 @@ F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_v { if (isAnimatedObject() && isRiggedMesh()) { + if (unscaled_value) + { + *unscaled_value = (linkset_base_cost + ANIMATED_OBJECT_COST_PER_KTRI * 0.001 * getEstTrianglesStreamingCost())/0.06; + } return linkset_base_cost + ANIMATED_OBJECT_COST_PER_KTRI * 0.001 * getEstTrianglesStreamingCost(); } else -- cgit v1.3 From bc773adf618eb531fdccacd95f4cd51f6b87497a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 24 Apr 2018 16:55:55 +0100 Subject: MAINT-8549 - refactoring of streaming cost and related calculations --- indra/llcharacter/lljoint.cpp | 2 +- indra/newview/llmeshrepository.cpp | 290 ++++++++++++++++++++++++++----------- indra/newview/llmeshrepository.h | 47 +++++- indra/newview/llvovolume.cpp | 4 - 4 files changed, 255 insertions(+), 88 deletions(-) (limited to 'indra/llcharacter/lljoint.cpp') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index abc5a95c8d..9d10f53bed 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -440,7 +440,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh llclamp(pos[2],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET)); if (constrained_pos != pos) { - LL_DEBUGS("Avatar") << "attachment pos override constrained to " + LL_DEBUGS("Avatar") << mesh_id << " joint " << getName() << " attachment pos override constrained to " << constrained_pos << " was " << pos << LL_ENDL; } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b27fdefb83..9687376cff 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4062,7 +4062,7 @@ void LLMeshRepository::uploadError(LLSD& args) mUploadErrorQ.push(args); } -bool LLMeshRepository::getLODSizes(LLUUID mesh_id, std::vector& lod_byte_sizes, std::vector& lod_tri_counts) +bool LLMeshRepository::getLODSizes(LLSD& header, std::vector& lod_byte_sizes, std::vector& lod_tri_counts) { lod_byte_sizes.resize(4); lod_tri_counts.resize(4); @@ -4070,120 +4070,111 @@ bool LLMeshRepository::getLODSizes(LLUUID mesh_id, std::vector& lod_byte_si std::fill(lod_byte_sizes.begin(), lod_byte_sizes.end(), 0); std::fill(lod_tri_counts.begin(), lod_tri_counts.end(), 0.f); - if (mThread && mesh_id.notNull()) + S32 bytes_high = header["high_lod"]["size"].asInteger(); + S32 bytes_med = header["medium_lod"]["size"].asInteger(); + if (bytes_med == 0) { - LLMutexLock lock(mThread->mHeaderMutex); - LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id); - if (iter != mThread->mMeshHeader.end() && mThread->mMeshHeaderSize[mesh_id] > 0) - { - LLSD& header = iter->second; - if (header.has("404") - || !header.has("lowest_lod") - || (header.has("version") && header["version"].asInteger() > MAX_MESH_VERSION)) - { - return false; - } - - S32 bytes_high = header["high_lod"]["size"].asInteger(); - S32 bytes_med = header["medium_lod"]["size"].asInteger(); - if (bytes_med == 0) - { - bytes_med = bytes_high; - } - S32 bytes_low = header["low_lod"]["size"].asInteger(); - if (bytes_low == 0) - { - bytes_low = bytes_med; - } - S32 bytes_lowest = header["lowest_lod"]["size"].asInteger(); - if (bytes_lowest == 0) - { - bytes_lowest = bytes_low; - } - lod_byte_sizes[0] = bytes_high; - lod_byte_sizes[1] = bytes_med; - lod_byte_sizes[2] = bytes_low; - lod_byte_sizes[3] = bytes_lowest; - - F32 METADATA_DISCOUNT = (F32) gSavedSettings.getU32("MeshMetaDataDiscount"); //discount 128 bytes to cover the cost of LLSD tags and compression domain overhead - F32 MINIMUM_SIZE = (F32) gSavedSettings.getU32("MeshMinimumByteSize"); //make sure nothing is "free" - F32 bytes_per_triangle = (F32) gSavedSettings.getU32("MeshBytesPerTriangle"); + bytes_med = bytes_high; + } + S32 bytes_low = header["low_lod"]["size"].asInteger(); + if (bytes_low == 0) + { + bytes_low = bytes_med; + } + S32 bytes_lowest = header["lowest_lod"]["size"].asInteger(); + if (bytes_lowest == 0) + { + bytes_lowest = bytes_low; + } + lod_byte_sizes[0] = bytes_lowest; + lod_byte_sizes[1] = bytes_low; + lod_byte_sizes[2] = bytes_med; + lod_byte_sizes[3] = bytes_high; - for (S32 i=0; i<4; i++) - { - lod_tri_counts[i] = llmax((F32) lod_byte_sizes[i]-METADATA_DISCOUNT, MINIMUM_SIZE)/bytes_per_triangle; - } + F32 METADATA_DISCOUNT = (F32) gSavedSettings.getU32("MeshMetaDataDiscount"); //discount 128 bytes to cover the cost of LLSD tags and compression domain overhead + F32 MINIMUM_SIZE = (F32) gSavedSettings.getU32("MeshMinimumByteSize"); //make sure nothing is "free" + F32 bytes_per_triangle = (F32) gSavedSettings.getU32("MeshBytesPerTriangle"); - return true; - } + for (S32 i=0; i<4; i++) + { + lod_tri_counts[i] = llmax((F32) lod_byte_sizes[i]-METADATA_DISCOUNT, MINIMUM_SIZE)/bytes_per_triangle; } - return false; + + return true; } F32 LLMeshRepository::getEstTrianglesMax(LLUUID mesh_id) { - std::vector lod_byte_sizes; - std::vector lod_tri_counts; - bool succ = getLODSizes(mesh_id, lod_byte_sizes, lod_tri_counts); - if (!succ) + LLMeshCostData costs; + if (getCostData(mesh_id, costs)) + { + return costs.mEstTrisMax; + } + else { return 0.f; } - - return llmax(lod_tri_counts[0], lod_tri_counts[1], lod_tri_counts[2], lod_tri_counts[3]); } F32 LLMeshRepository::getEstTrianglesStreamingCost(LLUUID mesh_id) { - std::vector lod_byte_sizes; - std::vector tris_by_lod; - bool succ = getLODSizes(mesh_id, lod_byte_sizes, tris_by_lod); - - if (!succ) + LLMeshCostData costs; + if (getCostData(mesh_id, costs)) { - LL_DEBUGS("StreamingCost") << "couldn't get tris_by_lod" << LL_ENDL; - return 0.f; + return costs.computeEstTrisForStreamingCost(); } - - LL_DEBUGS("StreamingCost") << "tris_by_lod: " - << tris_by_lod[0] << ", " - << tris_by_lod[1] << ", " - << tris_by_lod[2] << ", " - << tris_by_lod[3] << LL_ENDL; - - F32 charged_tris = tris_by_lod[0]; - F32 allowed_tris = tris_by_lod[0]; - const F32 ENFORCE_FLOOR = 64.0f; - for (S32 i=1; i<4; i++) + else { - // How many tris can we have in this LOD without affecting land impact? - // - normally an LOD should be at most half the size of the previous one. - // - once we reach a floor of ENFORCE_FLOOR, don't require LODs to get any smaller. - allowed_tris = llclamp(allowed_tris/2.0f,ENFORCE_FLOOR,tris_by_lod[i]); - F32 excess_tris = tris_by_lod[i]-allowed_tris; - if (excess_tris>0.f) - { - LL_DEBUGS("StreamingCost") << "excess tris in lod[" << i << "] " << excess_tris << " allowed " << allowed_tris << LL_ENDL; - charged_tris += excess_tris; - } + return 0.f; } - return charged_tris; } +// FIXME replace with calc based on LLMeshCostData F32 LLMeshRepository::getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) { + F32 result = 0.f; if (mThread && mesh_id.notNull()) { LLMutexLock lock(mThread->mHeaderMutex); LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id); if (iter != mThread->mMeshHeader.end() && mThread->mMeshHeaderSize[mesh_id] > 0) { - return getStreamingCost(iter->second, radius, bytes, bytes_visible, lod, unscaled_value); + result = getStreamingCost(iter->second, radius, bytes, bytes_visible, lod, unscaled_value); } } - return 0.f; + if (result > 0.f) + { + LLMeshCostData data; + if (getCostData(mesh_id, data)) + { + F32 ref_streaming_cost = data.computeRadiusBasedStreamingCost(radius); + F32 ref_weighted_tris = data.computeRadiusWeightedTris(radius); + if (!is_approx_equal(ref_streaming_cost,result)) + { + LL_WARNS() << mesh_id << "streaming mismatch " << result << " " << ref_streaming_cost << LL_ENDL; + } + if (unscaled_value && !is_approx_equal(ref_weighted_tris,*unscaled_value)) + { + LL_WARNS() << mesh_id << "weighted_tris mismatch " << *unscaled_value << " " << ref_weighted_tris << LL_ENDL; + } + if (bytes && (*bytes != data.mSizeTotal)) + { + LL_WARNS() << mesh_id << "bytes mismatch " << *bytes << " " << data.mSizeTotal << LL_ENDL; + } + if (bytes_visible && (lod >=0) && (lod < 4) && (*bytes_visible != data.mSizeByLOD[lod])) + { + LL_WARNS() << mesh_id << "bytes_visible mismatch " << *bytes_visible << " " << data.mSizeByLOD[lod] << LL_ENDL; + } + } + else + { + LL_WARNS() << "getCostData failed!!!" << LL_ENDL; + } + } + return result; } +// FIXME replace with calc based on LLMeshCostData //static F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) { @@ -4289,6 +4280,141 @@ F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32 return weighted_avg/gSavedSettings.getU32("MeshTriangleBudget")*15000.f; } +LLMeshCostData::LLMeshCostData() +{ + mSizeByLOD.resize(4); + mEstTrisByLOD.resize(4); + + std::fill(mSizeByLOD.begin(), mSizeByLOD.end(), 0); + std::fill(mEstTrisByLOD.begin(), mEstTrisByLOD.end(), 0.f); + + mSizeTotal = 0; + mEstTrisMax = 0; +} + +F32 LLMeshCostData::computeRadiusWeightedTris(F32 radius) +{ + F32 max_distance = 512.f; + + F32 dlowest = llmin(radius/0.03f, max_distance); + F32 dlow = llmin(radius/0.06f, max_distance); + F32 dmid = llmin(radius/0.24f, max_distance); + + F32 triangles_lowest = mEstTrisByLOD[0]; + F32 triangles_low = mEstTrisByLOD[1]; + F32 triangles_mid = mEstTrisByLOD[2]; + F32 triangles_high = mEstTrisByLOD[3]; + + F32 max_area = 102944.f; //area of circle that encompasses region (see MAINT-6559) + F32 min_area = 1.f; + + F32 high_area = llmin(F_PI*dmid*dmid, max_area); + F32 mid_area = llmin(F_PI*dlow*dlow, max_area); + F32 low_area = llmin(F_PI*dlowest*dlowest, max_area); + F32 lowest_area = max_area; + + lowest_area -= low_area; + low_area -= mid_area; + mid_area -= high_area; + + high_area = llclamp(high_area, min_area, max_area); + mid_area = llclamp(mid_area, min_area, max_area); + low_area = llclamp(low_area, min_area, max_area); + lowest_area = llclamp(lowest_area, min_area, max_area); + + F32 total_area = high_area + mid_area + low_area + lowest_area; + high_area /= total_area; + mid_area /= total_area; + low_area /= total_area; + lowest_area /= total_area; + + F32 weighted_avg = triangles_high*high_area + + triangles_mid*mid_area + + triangles_low*low_area + + triangles_lowest*lowest_area; + + return weighted_avg; +} + +F32 LLMeshCostData::computeEstTrisForStreamingCost() +{ + LL_DEBUGS("StreamingCost") << "tris_by_lod: " + << mEstTrisByLOD[0] << ", " + << mEstTrisByLOD[1] << ", " + << mEstTrisByLOD[2] << ", " + << mEstTrisByLOD[3] << LL_ENDL; + + F32 charged_tris = mEstTrisByLOD[3]; + F32 allowed_tris = mEstTrisByLOD[3]; + const F32 ENFORCE_FLOOR = 64.0f; + for (S32 i=2; i>=0; i--) + { + // How many tris can we have in this LOD without affecting land impact? + // - normally an LOD should be at most half the size of the previous one. + // - once we reach a floor of ENFORCE_FLOOR, don't require LODs to get any smaller. + allowed_tris = llclamp(allowed_tris/2.0f,ENFORCE_FLOOR,mEstTrisByLOD[i]); + F32 excess_tris = mEstTrisByLOD[i]-allowed_tris; + if (excess_tris>0.f) + { + LL_DEBUGS("StreamingCost") << "excess tris in lod[" << i << "] " << excess_tris << " allowed " << allowed_tris << LL_ENDL; + charged_tris += excess_tris; + } + } + return charged_tris; +} + +F32 LLMeshCostData::computeRadiusBasedStreamingCost(F32 radius) +{ + return computeRadiusWeightedTris(radius)/gSavedSettings.getU32("MeshTriangleBudget")*15000.f; +} + +F32 LLMeshCostData::computeTriangleBasedStreamingCost() +{ + F32 result = ANIMATED_OBJECT_COST_PER_KTRI * 0.001 * computeEstTrisForStreamingCost()/0.06; + return result; +} + +bool LLMeshRepository::getCostData(LLUUID mesh_id, LLMeshCostData& data) +{ + data = LLMeshCostData(); + + if (mThread && mesh_id.notNull()) + { + LLMutexLock lock(mThread->mHeaderMutex); + LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id); + if (iter != mThread->mMeshHeader.end() && mThread->mMeshHeaderSize[mesh_id] > 0) + { + LLSD& header = iter->second; + + bool header_invalid = (header.has("404") + || !header.has("lowest_lod") + || (header.has("version") && header["version"].asInteger() > MAX_MESH_VERSION)); + if (!header_invalid) + { + return getCostData(header, mesh_id, data); + } + + return true; + } + } + return false; +} + +bool LLMeshRepository::getCostData(LLSD& header, LLUUID mesh_id, LLMeshCostData& data) +{ + data = LLMeshCostData(); + + if (!getLODSizes(header, data.mSizeByLOD, data.mEstTrisByLOD)) + { + return false; + } + + data.mEstTrisMax = llmax(data.mEstTrisByLOD[0], data.mEstTrisByLOD[1], data.mEstTrisByLOD[2], data.mEstTrisByLOD[3]); + + data.mSizeTotal = data.mSizeByLOD[0] + data.mSizeByLOD[1] + data.mSizeByLOD[2] + data.mSizeByLOD[3]; + + return true; +} LLPhysicsDecomp::LLPhysicsDecomp() : LLThread("Physics Decomp") diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index bae3f66a72..e43f719471 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -451,6 +451,45 @@ private: LLCore::HttpRequest::priority_t mHttpPriority; }; +// Params related to streaming cost, render cost, and scene complexity tracking. +struct LLMeshCostData +{ + LLMeshCostData(); + + // From the "size" field of the mesh header. LOD 0=lowest, 3=highest. + std::vector mSizeByLOD; + + // Estimated triangle counts derived from the LOD sizes. LOD 0=lowest, 3=highest. + std::vector mEstTrisByLOD; + + // Estimated triangle counts for the largest LOD. Typically this + // is also the "high" LOD, but not necessarily. + F32 mEstTrisMax; + + // Sum of all LOD sizes. + S32 mSizeTotal; + + // Helper functions for building data + + // Triangle count as computed by original streaming cost + // formula. Triangles in each LOD are weighted based on how + // frequently they will be seen. + // This was called "unscaled_value" in the original getStreamingCost() functions. + F32 computeRadiusWeightedTris(F32 radius); + + // Triangle count used by triangle-based cost formula. Based on + // triangles in highest LOD plus potentially partial charges for + // lower LODs depending on complexity. + F32 computeEstTrisForStreamingCost(); + + // Streaming cost. This should match the server-side calculation + // for the corresponding volume. + F32 computeRadiusBasedStreamingCost(F32 radius); + + // New streaming cost formula, currently only used for animated objects. + F32 computeTriangleBasedStreamingCost(); +}; + class LLMeshRepository { public: @@ -472,12 +511,14 @@ public: static LLDeadmanTimer sQuiescentTimer; // Time-to-complete-mesh-downloads after significant events - bool getLODSizes(LLUUID mesh_id, std::vector& lod_byte_sizes, std::vector& lod_tri_counts); + bool getLODSizes(LLSD& header, std::vector& lod_byte_sizes, std::vector& lod_tri_counts); // Estimated triangle count of the largest LOD F32 getEstTrianglesMax(LLUUID mesh_id); F32 getEstTrianglesStreamingCost(LLUUID mesh_id); F32 getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); + bool getCostData(LLUUID mesh_id, LLMeshCostData& data); + bool getCostData(LLSD& header, LLUUID mesh_id, LLMeshCostData& data); LLMeshRepository(); @@ -588,5 +629,9 @@ public: extern LLMeshRepository gMeshRepo; +// AXON make sure this is consistent with the final simulator-side values. +const F32 ANIMATED_OBJECT_BASE_COST = 15.0f; +const F32 ANIMATED_OBJECT_COST_PER_KTRI = 1.5f; + #endif diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index bf646eb44b..9db4b3de0c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3918,10 +3918,6 @@ F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_v { F32 radius = getScale().length()*0.5f; - // AXON make sure this is consistent with the final simulator-side values. - const F32 ANIMATED_OBJECT_BASE_COST = 15.0f; - const F32 ANIMATED_OBJECT_COST_PER_KTRI = 1.5f; - F32 linkset_base_cost = 0.f; if (isAnimatedObject() && isRootEdit()) { -- cgit v1.3 From b42b0a9fb9b9aa777c73729f3313a0f1584def86 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 14 May 2018 14:15:10 +0100 Subject: MAINT-8554 - disabled joint position clamping for now --- indra/llcharacter/lljoint.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcharacter/lljoint.cpp') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 9d10f53bed..07fcd99701 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -435,6 +435,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh // return; //} +#if 0 // AXON MAINT-8554 - this may be overly restrictive for large models LLVector3 constrained_pos = LLVector3(llclamp(pos[0],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), llclamp(pos[1],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), llclamp(pos[2],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET)); @@ -443,6 +444,9 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh LL_DEBUGS("Avatar") << mesh_id << " joint " << getName() << " attachment pos override constrained to " << constrained_pos << " was " << pos << LL_ENDL; } +#else + LLVector3 constrained_pos = pos; +#endif LLVector3 before_pos; LLUUID before_mesh_id; -- cgit v1.3 From e86839fac19753d0fa4006296c7f8909fe781013 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Jun 2018 15:08:59 +0100 Subject: SL-915 - WIP on dynamic joint box tracking --- indra/llcharacter/lljoint.cpp | 53 +++++++++++++++++++++++++ indra/llcharacter/lljoint.h | 22 +++++++++++ indra/llmath/CMakeLists.txt | 1 + indra/llmath/llmatrix4a.cpp | 80 +++++++++++++++++++++++++++++++++++++ indra/llmath/llmatrix4a.h | 8 ++-- indra/llprimitive/llmodel.h | 1 - indra/newview/llface.cpp | 92 +++++++++++-------------------------------- indra/newview/llvoavatar.cpp | 39 ++++++++++++++++-- 8 files changed, 218 insertions(+), 78 deletions(-) create mode 100644 indra/llmath/llmatrix4a.cpp (limited to 'indra/llcharacter/lljoint.cpp') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 07fcd99701..68355cbbdc 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -96,6 +96,46 @@ void LLVector3OverrideMap::clear() m_map.clear(); } +//----------------------------------------------------------------------------- +// LLJointRiggingInfo +//----------------------------------------------------------------------------- +LLJointRiggingInfo::LLJointRiggingInfo() +{ + mRiggedExtents[0].clear(); + mRiggedExtents[1].clear(); + mIsRiggedTo = false; +} + +bool LLJointRiggingInfo::isRiggedTo() const +{ + return mIsRiggedTo; +} + +void LLJointRiggingInfo::setIsRiggedTo(bool val) +{ + mIsRiggedTo = val; +} + +LLVector4a *LLJointRiggingInfo::getRiggedExtents() +{ + return mRiggedExtents; +} + +const LLVector4a *LLJointRiggingInfo::getRiggedExtents() const +{ + return mRiggedExtents; +} + +// Combine two rigging info states. +// - isRiggedTo if either of the source infos are rigged to +// - box is union of the two sources +void LLJointRiggingInfo::merge(const LLJointRiggingInfo& other) +{ + mIsRiggedTo = mIsRiggedTo || other.mIsRiggedTo; + update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[0]); + update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[1]); +} + //----------------------------------------------------------------------------- // LLJoint() // Class Constructor @@ -597,6 +637,19 @@ void LLJoint::showAttachmentPosOverrides(const std::string& av_info) const } } +//-------------------------------------------------------------------- +// getRiggingInfo() +//-------------------------------------------------------------------- +LLJointRiggingInfo& LLJoint::getRiggingInfo() +{ + return mRiggingInfo; +} + +const LLJointRiggingInfo& LLJoint::getRiggingInfo() const +{ + return mRiggingInfo; +} + //-------------------------------------------------------------------- // updatePos() //-------------------------------------------------------------------- diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 8112d246f2..ff1e967188 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -70,6 +70,23 @@ private: map_type m_map; }; +// Stores information related to associated rigged mesh vertices +// Extents are in joint space +// isRiggedTo is based on the state of all currently associated rigged meshes +class LLJointRiggingInfo +{ +public: + LLJointRiggingInfo(); + bool isRiggedTo() const; + void setIsRiggedTo(bool val); + LLVector4a *getRiggedExtents(); + const LLVector4a *getRiggedExtents() const; + void merge(const LLJointRiggingInfo& other); +private: + LL_ALIGN_16(LLVector4a mRiggedExtents[2]); + bool mIsRiggedTo; +}; + inline bool operator==(const LLVector3OverrideMap& a, const LLVector3OverrideMap& b) { return a.getMap() == b.getMap(); @@ -158,6 +175,11 @@ public: LLVector3OverrideMap m_attachmentScaleOverrides; LLVector3 m_scaleBeforeOverrides; + // Rigging Info + LLJointRiggingInfo mRiggingInfo; + LLJointRiggingInfo& getRiggingInfo(); + const LLJointRiggingInfo& getRiggingInfo() const; + void updatePos(const std::string& av_info); void updateScale(const std::string& av_info); diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 4c8bcdac91..dab566da56 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -20,6 +20,7 @@ set(llmath_SOURCE_FILES llcoordframe.cpp llline.cpp llmatrix3a.cpp + llmatrix4a.cpp llmodularmath.cpp lloctree.cpp llperlin.cpp diff --git a/indra/llmath/llmatrix4a.cpp b/indra/llmath/llmatrix4a.cpp new file mode 100644 index 0000000000..fe8f0b98f3 --- /dev/null +++ b/indra/llmath/llmatrix4a.cpp @@ -0,0 +1,80 @@ +/** +* @file llmatrix4a.cpp +* @brief Functions for vectorized matrix/vector operations +* +* $LicenseInfo:firstyear=2018&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2018, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llmath.h" +#include "llmatrix4a.h" + +// Convert a bounding box into other coordinate system. Should give +// the same results as transforming every corner of the bounding box +// and extracting the bounding box of that, although that's not +// necessarily the fastest way to implement. +void matMulBoundBox(const LLMatrix4a &mat, const LLVector4a *in_extents, LLVector4a *out_extents) +{ + //get 8 corners of bounding box + LLVector4Logical mask[6]; + + for (U32 i = 0; i < 6; ++i) + { + mask[i].clear(); + } + + mask[0].setElement<2>(); //001 + mask[1].setElement<1>(); //010 + mask[2].setElement<1>(); //011 + mask[2].setElement<2>(); + mask[3].setElement<0>(); //100 + mask[4].setElement<0>(); //101 + mask[4].setElement<2>(); + mask[5].setElement<0>(); //110 + mask[5].setElement<1>(); + + LLVector4a v[8]; + + v[6] = in_extents[0]; + v[7] = in_extents[1]; + + for (U32 i = 0; i < 6; ++i) + { + v[i].setSelectWithMask(mask[i], in_extents[0], in_extents[1]); + } + + LLVector4a tv[8]; + + //transform bounding box into drawable space + for (U32 i = 0; i < 8; ++i) + { + mat.affineTransform(v[i], tv[i]); + } + + //find bounding box + out_extents[0] = out_extents[1] = tv[0]; + + for (U32 i = 1; i < 8; ++i) + { + out_extents[0].setMin(out_extents[0], tv[i]); + out_extents[1].setMax(out_extents[1], tv[i]); + } +} diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index baa3a89176..7ba347062f 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -121,7 +121,7 @@ public: res.add(z); } - inline void affineTransformSSE(const LLVector4a& v, LLVector4a& res) + inline void affineTransformSSE(const LLVector4a& v, LLVector4a& res) const { LLVector4a x,y,z; @@ -138,7 +138,7 @@ public: res.setAdd(x,z); } - inline void affineTransformNonSSE(const LLVector4a& v, LLVector4a& res) + inline void affineTransformNonSSE(const LLVector4a& v, LLVector4a& res) const { F32 x = v[0] * mMatrix[0][0] + v[1] * mMatrix[1][0] + v[2] * mMatrix[2][0] + mMatrix[3][0]; F32 y = v[0] * mMatrix[0][1] + v[1] * mMatrix[1][1] + v[2] * mMatrix[2][1] + mMatrix[3][1]; @@ -147,7 +147,7 @@ public: res.set(x,y,z,w); } - inline void affineTransform(const LLVector4a& v, LLVector4a& res) + inline void affineTransform(const LLVector4a& v, LLVector4a& res) const { affineTransformSSE(v,res); } @@ -182,4 +182,6 @@ inline std::ostream& operator<<(std::ostream& s, const LLMatrix4a& m) return s; } +void matMulBoundBox(const LLMatrix4a &a, const LLVector4a *in_extents, LLVector4a *out_extents); + #endif diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 097558ef67..53585d2e04 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -38,7 +38,6 @@ class domMesh; #define MAX_MODEL_FACES 8 - class LLMeshSkinInfo { public: diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index efd57ec39f..7bc7814392 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -810,17 +810,11 @@ bool less_than_max_mag(const LLVector4a& vec) } BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, - const LLMatrix4& mat_vert_in, BOOL global_volume) + const LLMatrix4& mat_vert_in, BOOL global_volume) { //get bounding box if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED)) { - //VECTORIZE THIS - LLMatrix4a mat_vert; - mat_vert.loadu(mat_vert_in); - - LLVector4a min,max; - if (f >= volume.getNumVolumeFaces()) { LL_WARNS() << "Generating bounding box for invalid face index!" << LL_ENDL; @@ -828,39 +822,11 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, } const LLVolumeFace &face = volume.getVolumeFace(f); - min = face.mExtents[0]; - max = face.mExtents[1]; - LL_DEBUGS("RiggedBox") << "updating extents for face " << f << " starting extents " << mExtents[0] << ", " << mExtents[1] << LL_ENDL; - LL_DEBUGS("RiggedBox") << "updating extents for face " << f << " starting vf extents " << face.mExtents[0] << ", " << face.mExtents[1] << " num verts " << face.mNumVertices << LL_ENDL; - - llassert(less_than_max_mag(min)); - llassert(less_than_max_mag(max)); - - //min, max are in volume space, convert to drawable render space - - //get 8 corners of bounding box - LLVector4Logical mask[6]; - - for (U32 i = 0; i < 6; ++i) - { - mask[i].clear(); - } - - mask[0].setElement<2>(); //001 - mask[1].setElement<1>(); //010 - mask[2].setElement<1>(); //011 - mask[2].setElement<2>(); - mask[3].setElement<0>(); //100 - mask[4].setElement<0>(); //101 - mask[4].setElement<2>(); - mask[5].setElement<0>(); //110 - mask[5].setElement<1>(); - - LLVector4a v[8]; - - v[6] = min; - v[7] = max; + LL_DEBUGS("RiggedBox") << "updating extents for face " << f + << " starting extents " << mExtents[0] << ", " << mExtents[1] + << " starting vf extents " << face.mExtents[0] << ", " << face.mExtents[1] + << " num verts " << face.mNumVertices << LL_ENDL; // MAINT-8264 - stray vertices, especially in low LODs, cause bounding box errors. if (face.mNumVertices < 3) @@ -870,52 +836,38 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, return FALSE; } - for (U32 i = 0; i < 6; ++i) - { - v[i].setSelectWithMask(mask[i], min, max); - } - - LLVector4a tv[8]; - - LL_DEBUGS("RiggedBox") << "updating extents for face " << f << " mat is " << mat_vert << LL_ENDL; + //VECTORIZE THIS + LLMatrix4a mat_vert; + mat_vert.loadu(mat_vert_in); + LLVector4a new_extents[2]; - //transform bounding box into drawable space - for (U32 i = 0; i < 8; ++i) - { - mat_vert.affineTransform(v[i], tv[i]); - LL_DEBUGS("RiggedBox") << "updating extents for face " << f << " i " << i << " v and tv " << v[i] << ", " << tv[i] << LL_ENDL; - } - - //find bounding box - LLVector4a& newMin = mExtents[0]; - LLVector4a& newMax = mExtents[1]; + llassert(less_than_max_mag(face.mExtents[0])); + llassert(less_than_max_mag(face.mExtents[1])); - newMin = newMax = tv[0]; + matMulBoundBox(mat_vert, face.mExtents, mExtents); - for (U32 i = 1; i < 8; ++i) - { - newMin.setMin(newMin, tv[i]); - newMax.setMax(newMax, tv[i]); - } - LL_DEBUGS("RiggedBox") << "updating extents for face " << f << " bbox gave extents " << mExtents[0] << ", " << mExtents[1] << LL_ENDL; + LL_DEBUGS("RiggedBox") << "updated extents for face " << f + << " bbox gave extents " << mExtents[0] << ", " << mExtents[1] << LL_ENDL; if (!mDrawablep->isActive()) { // Shift position for region LLVector4a offset; offset.load3(mDrawablep->getRegion()->getOriginAgent().mV); - newMin.add(offset); - newMax.add(offset); - LL_DEBUGS("RiggedBox") << "updating extents for face " << f << " not active, added offset " << offset << LL_ENDL; + mExtents[0].add(offset); + mExtents[1].add(offset); + LL_DEBUGS("RiggedBox") << "updating extents for face " << f + << " not active, added offset " << offset << LL_ENDL; } - LL_DEBUGS("RiggedBox") << "updated extents for face " << f << " to " << mExtents[0] << ", " << mExtents[1] << LL_ENDL; + LL_DEBUGS("RiggedBox") << "updated extents for face " << f + << " to " << mExtents[0] << ", " << mExtents[1] << LL_ENDL; LLVector4a t; - t.setAdd(newMin,newMax); + t.setAdd(mExtents[0],mExtents[1]); t.mul(0.5f); mCenterLocal.set(t.getF32ptr()); - t.setSub(newMax,newMin); + t.setSub(mExtents[1],mExtents[0]); mBoundingSphereRadius = t.getLength3().getF32()*0.5f; updateCenterAgent(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0ea29bae58..277f8e4533 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1277,13 +1277,11 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) mImpostorOffset = LLVector3(pos_group.getF32ptr())-getRenderPosition(); mDrawable->setPositionGroup(pos_group); } - - } void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { - LLVector4a buffer(0.25f); + LLVector4a buffer(0.0); LLVector4a pos; pos.load3(getRenderPosition().mV); newMin.setSub(pos, buffer); @@ -1312,7 +1310,7 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) mPixelArea = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance()); - //stretch bounding box by attachments + //stretch bounding box by static attachments for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -1356,6 +1354,39 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) } } + // Stretch bounding box by rigged mesh joint boxes + for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) + { + LLJoint *joint = getJoint(joint_num); + + // FIXME TEMP HACK FOR TESTING + if (joint) + { + joint->getRiggingInfo().setIsRiggedTo(true); + } + + if (joint && joint->getRiggingInfo().isRiggedTo()) + { + LLViewerJointAttachment *as_joint_attach = dynamic_cast(joint); + if (as_joint_attach && as_joint_attach->getIsHUDAttachment()) + { + // Ignore bounding box of HUD joints + continue; + } + LLMatrix4a mat; + LLVector4a new_extents[2]; + mat.loadu(joint->getWorldMatrix()); + matMulBoundBox(mat, joint->getRiggingInfo().getRiggedExtents(), new_extents); + update_min_max(newMin, newMax, new_extents[0]); + update_min_max(newMin, newMax, new_extents[1]); + //if (isSelf()) + //{ + // LL_INFOS() << joint->getName() << " extents " << new_extents[0] << "," << new_extents[1] << LL_ENDL; + // LL_INFOS() << joint->getName() << " av box is " << newMin << "," << newMax << LL_ENDL; + //} + } + } + //pad bounding box newMin.sub(buffer); -- cgit v1.3 From 228525aa27b05cc1aa8be27de4ae59f5ec590ae3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 4 Jun 2018 14:43:06 +0100 Subject: SL-915 - tracking joint is rigged state --- indra/llcharacter/lljoint.cpp | 53 ---------------------- indra/llcharacter/lljoint.h | 22 --------- indra/llmath/CMakeLists.txt | 2 + indra/llmath/llrigginginfo.cpp | 96 ++++++++++++++++++++++++++++++++++++++++ indra/llmath/llrigginginfo.h | 55 +++++++++++++++++++++++ indra/newview/llskinningutil.cpp | 25 +++++++++++ indra/newview/llskinningutil.h | 4 ++ indra/newview/llviewerobject.h | 5 +++ indra/newview/llvoavatar.cpp | 91 ++++++++++++++++++++++++++++++++++--- indra/newview/llvoavatar.h | 6 +++ indra/newview/llvovolume.cpp | 15 +++++++ indra/newview/llvovolume.h | 3 ++ 12 files changed, 295 insertions(+), 82 deletions(-) create mode 100644 indra/llmath/llrigginginfo.cpp create mode 100644 indra/llmath/llrigginginfo.h (limited to 'indra/llcharacter/lljoint.cpp') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 68355cbbdc..07fcd99701 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -96,46 +96,6 @@ void LLVector3OverrideMap::clear() m_map.clear(); } -//----------------------------------------------------------------------------- -// LLJointRiggingInfo -//----------------------------------------------------------------------------- -LLJointRiggingInfo::LLJointRiggingInfo() -{ - mRiggedExtents[0].clear(); - mRiggedExtents[1].clear(); - mIsRiggedTo = false; -} - -bool LLJointRiggingInfo::isRiggedTo() const -{ - return mIsRiggedTo; -} - -void LLJointRiggingInfo::setIsRiggedTo(bool val) -{ - mIsRiggedTo = val; -} - -LLVector4a *LLJointRiggingInfo::getRiggedExtents() -{ - return mRiggedExtents; -} - -const LLVector4a *LLJointRiggingInfo::getRiggedExtents() const -{ - return mRiggedExtents; -} - -// Combine two rigging info states. -// - isRiggedTo if either of the source infos are rigged to -// - box is union of the two sources -void LLJointRiggingInfo::merge(const LLJointRiggingInfo& other) -{ - mIsRiggedTo = mIsRiggedTo || other.mIsRiggedTo; - update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[0]); - update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[1]); -} - //----------------------------------------------------------------------------- // LLJoint() // Class Constructor @@ -637,19 +597,6 @@ void LLJoint::showAttachmentPosOverrides(const std::string& av_info) const } } -//-------------------------------------------------------------------- -// getRiggingInfo() -//-------------------------------------------------------------------- -LLJointRiggingInfo& LLJoint::getRiggingInfo() -{ - return mRiggingInfo; -} - -const LLJointRiggingInfo& LLJoint::getRiggingInfo() const -{ - return mRiggingInfo; -} - //-------------------------------------------------------------------- // updatePos() //-------------------------------------------------------------------- diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index ff1e967188..8112d246f2 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -70,23 +70,6 @@ private: map_type m_map; }; -// Stores information related to associated rigged mesh vertices -// Extents are in joint space -// isRiggedTo is based on the state of all currently associated rigged meshes -class LLJointRiggingInfo -{ -public: - LLJointRiggingInfo(); - bool isRiggedTo() const; - void setIsRiggedTo(bool val); - LLVector4a *getRiggedExtents(); - const LLVector4a *getRiggedExtents() const; - void merge(const LLJointRiggingInfo& other); -private: - LL_ALIGN_16(LLVector4a mRiggedExtents[2]); - bool mIsRiggedTo; -}; - inline bool operator==(const LLVector3OverrideMap& a, const LLVector3OverrideMap& b) { return a.getMap() == b.getMap(); @@ -175,11 +158,6 @@ public: LLVector3OverrideMap m_attachmentScaleOverrides; LLVector3 m_scaleBeforeOverrides; - // Rigging Info - LLJointRiggingInfo mRiggingInfo; - LLJointRiggingInfo& getRiggingInfo(); - const LLJointRiggingInfo& getRiggingInfo() const; - void updatePos(const std::string& av_info); void updateScale(const std::string& av_info); diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index dab566da56..379c3ee9ea 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -25,6 +25,7 @@ set(llmath_SOURCE_FILES lloctree.cpp llperlin.cpp llquaternion.cpp + llrigginginfo.cpp llrect.cpp llsphere.cpp llvector4a.cpp @@ -71,6 +72,7 @@ set(llmath_HEADER_FILES llquaternion2.h llquaternion2.inl llrect.h + llrigginginfo.h llsimdmath.h llsimdtypes.h llsimdtypes.inl diff --git a/indra/llmath/llrigginginfo.cpp b/indra/llmath/llrigginginfo.cpp new file mode 100644 index 0000000000..925179c2ba --- /dev/null +++ b/indra/llmath/llrigginginfo.cpp @@ -0,0 +1,96 @@ +/** +* @file llrigginginfo.cpp +* @brief Functions for tracking rigged box extents +* +* $LicenseInfo:firstyear=2018&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2018, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llmath.h" +#include "llrigginginfo.h" + +//----------------------------------------------------------------------------- +// LLJointRiggingInfo +//----------------------------------------------------------------------------- +LLJointRiggingInfo::LLJointRiggingInfo() +{ + mRiggedExtents[0].clear(); + mRiggedExtents[1].clear(); + mIsRiggedTo = false; +} + +bool LLJointRiggingInfo::isRiggedTo() const +{ + return mIsRiggedTo; +} + +void LLJointRiggingInfo::setIsRiggedTo(bool val) +{ + mIsRiggedTo = val; +} + +LLVector4a *LLJointRiggingInfo::getRiggedExtents() +{ + return mRiggedExtents; +} + +const LLVector4a *LLJointRiggingInfo::getRiggedExtents() const +{ + return mRiggedExtents; +} + +// Combine two rigging info states. +// - isRiggedTo if either of the source infos are rigged to +// - box is union of the two sources +void LLJointRiggingInfo::merge(const LLJointRiggingInfo& other) +{ + if (other.mIsRiggedTo) + { + if (mIsRiggedTo) + { + // Combine existing boxes + update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[0]); + update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[1]); + } + else + { + // Initialize box + mIsRiggedTo = true; + mRiggedExtents[0] = other.mRiggedExtents[0]; + mRiggedExtents[1] = other.mRiggedExtents[1]; + } + } +} + +void mergeRigInfoTab(joint_rig_info_tab& dst, const joint_rig_info_tab& src) +{ + // Size should be either LL_CHARACTER_MAX_ANIMATED_JOINTS, or 0 if + // no data. Not necessarily the same for both inputs. + if (src.size() > dst.size()) + { + dst.resize(src.size()); + } + S32 size = llmin(src.size(), dst.size()); + for (S32 i=0; i joint_rig_info_tab; + +void mergeRigInfoTab(joint_rig_info_tab& dst, const joint_rig_info_tab& src); + +#endif diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index dba690242a..7adb2fa8d2 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -216,3 +216,28 @@ void LLSkinningUtil::getPerVertexSkinMatrix( llassert(valid_weights); } +//static +void LLSkinningUtil::initIsRiggedTo(const LLMeshSkinInfo* skin, LLVOAvatar *avatar, joint_rig_info_tab& rig_info_tab) +{ + S32 rigged_count = 0; + rig_info_tab.resize(LL_CHARACTER_MAX_ANIMATED_JOINTS); + for (U32 j = 0; j < skin->mJointNames.size(); ++j) + { + LLJoint *joint = NULL; + if (skin->mJointNums[j] == -1) + { + joint = avatar->getJoint(skin->mJointNames[j]); + if (joint) + { + skin->mJointNums[j] = joint->getJointNum(); + } + } + S32 joint_num = skin->mJointNums[j]; + if (joint_num != -1) + { + rig_info_tab[joint_num].setIsRiggedTo(true); + rigged_count++; + } + } + //LL_INFOS() << "rigged_count " << rigged_count << LL_ENDL; +} diff --git a/indra/newview/llskinningutil.h b/indra/newview/llskinningutil.h index 135b25d4d2..3eba3dc93a 100644 --- a/indra/newview/llskinningutil.h +++ b/indra/newview/llskinningutil.h @@ -31,6 +31,9 @@ class LLVOAvatar; class LLMeshSkinInfo; class LLMatrix4a; +#include "llrigginginfo.h" + +// This should probably just be a namespace class LLSkinningUtil { public: @@ -42,6 +45,7 @@ public: static void checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin); static void scrubSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin); static void getPerVertexSkinMatrix(F32* weights, LLMatrix4a* mat, bool handle_bad_scale, LLMatrix4a& final_mat, U32 max_joints); + static void initIsRiggedTo(const LLMeshSkinInfo* skin, LLVOAvatar *avatar, joint_rig_info_tab& rig_info_tab); }; #endif diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 9552d4e99e..b9840f629b 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -42,6 +42,7 @@ #include "v3math.h" #include "llvertexbuffer.h" #include "llbbox.h" +#include "llrigginginfo.h" class LLAgent; // TODO: Get rid of this. class LLAudioSource; @@ -877,6 +878,10 @@ public: BOOL getLastUpdateCached() const; void setLastUpdateCached(BOOL last_update_cached); + virtual void updateRiggingInfo() {} + + joint_rig_info_tab mJointRiggingInfoTab; + private: LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory. EObjectUpdateType mLastUpdateType; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 277f8e4533..50a012ad82 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1355,17 +1355,23 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) } // Stretch bounding box by rigged mesh joint boxes + updateRiggingInfo(); for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) { LLJoint *joint = getJoint(joint_num); - - // FIXME TEMP HACK FOR TESTING - if (joint) + LLJointRiggingInfo *rig_info = NULL; + if (joint_num < mJointRiggingInfoTab.size()) { - joint->getRiggingInfo().setIsRiggedTo(true); + rig_info = &mJointRiggingInfoTab[joint_num]; } - if (joint && joint->getRiggingInfo().isRiggedTo()) + // FIXME TEMP HACK FOR TESTING + //if (joint) + //{ + // rig_info.setIsRiggedTo(true); + //} + + if (joint && rig_info && rig_info->isRiggedTo()) { LLViewerJointAttachment *as_joint_attach = dynamic_cast(joint); if (as_joint_attach && as_joint_attach->getIsHUDAttachment()) @@ -1376,7 +1382,7 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) LLMatrix4a mat; LLVector4a new_extents[2]; mat.loadu(joint->getWorldMatrix()); - matMulBoundBox(mat, joint->getRiggingInfo().getRiggedExtents(), new_extents); + matMulBoundBox(mat, rig_info->getRiggedExtents(), new_extents); update_min_max(newMin, newMax, new_extents[0]); update_min_max(newMin, newMax, new_extents[1]); //if (isSelf()) @@ -5777,6 +5783,7 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) return false; } +// AXON update to use LLRiggingInfo bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name) { for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); @@ -5798,6 +5805,7 @@ bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name) return false; } +// AXON update to use LLRiggingInfo bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name, const LLViewerObject *vo) { // Process all children @@ -9420,11 +9428,80 @@ BOOL LLVOAvatar::updateLOD() return res; } -void LLVOAvatar::updateLODRiggedAttachments( void ) +void LLVOAvatar::updateLODRiggedAttachments() { updateLOD(); rebuildRiggedAttachments(); } + +S32 countRigInfoTab(joint_rig_info_tab& tab) +{ + S32 count=0; + for (S32 i=0; isecond; + LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_end = attachment->mAttachedObjects.end(); + + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_iter = attachment->mAttachedObjects.begin(); + attach_iter != attach_end; ++attach_iter) + { + LLViewerObject* attached_object = *attach_iter; + attached_object->updateRiggingInfo(); + mergeRigInfoTab(mJointRiggingInfoTab, attached_object->mJointRiggingInfoTab); + //LL_INFOS() << "after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; + + + LLViewerObject::const_child_list_t& children = attached_object->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; + childp->updateRiggingInfo(); + mergeRigInfoTab(mJointRiggingInfoTab, childp->mJointRiggingInfoTab); + //LL_INFOS() << "after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; + } + } + } + LLControlAvatar *control_av = dynamic_cast(this); + if (control_av) + { + LLVOVolume *volp = control_av->mRootVolp; + if (volp && !volp->isAttachment()) + { + volp->updateRiggingInfo(); + mergeRigInfoTab(mJointRiggingInfoTab, volp->mJointRiggingInfoTab); + //LL_INFOS() << "cav after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; + + LLViewerObject::const_child_list_t& children = volp->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; + childp->updateRiggingInfo(); + mergeRigInfoTab(mJointRiggingInfoTab, childp->mJointRiggingInfoTab); + //LL_INFOS() << "cav after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; + } + } + } + + //LL_INFOS() << "done update rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; +} + U32 LLVOAvatar::getPartitionType() const { // Avatars merely exist as drawables in the bridge partition diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index cccf857eba..59f88490d0 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -49,6 +49,7 @@ #include "lldriverparam.h" #include "llviewertexlayer.h" #include "material_codes.h" // LL_MCODE_END +#include "llrigginginfo.h" #include "llviewerstats.h" #include "llvovolume.h" #include "llavatarrendernotifier.h" @@ -216,7 +217,12 @@ public: void getAttachmentOverrideNames(std::set& pos_names, std::set& scale_names) const; + // virtual + void updateRiggingInfo(); + std::set mActiveOverrideMeshes; + + /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b60ff6d280..321ea22ff9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3564,6 +3564,21 @@ void LLVOVolume::afterReparent() } } +//---------------------------------------------------------------------------- +void LLVOVolume::updateRiggingInfo() +{ + if (isRiggedMesh()) + { + const LLMeshSkinInfo* skin = getSkinInfo(); + LLVOAvatar *avatar = getAvatar(); + if (skin && avatar) + { + LLSkinningUtil::initIsRiggedTo(skin, avatar, mJointRiggingInfoTab); + } + // AXON add bbox processing from volume faces. + } +} + //---------------------------------------------------------------------------- void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point) diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index ebf92acc4f..d77c2f231b 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -282,6 +282,9 @@ public: virtual void onReparent(LLViewerObject *old_parent, LLViewerObject *new_parent); virtual void afterReparent(); + //virtual + void updateRiggingInfo(); + // Functions that deal with media, or media navigation // Update this object's media data with the given media data array -- cgit v1.3 From 56458152aca5a25663377fc9dde087de78bfb412 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 8 Aug 2018 22:11:32 +0100 Subject: SL-704 - code cleanup, mostly old AXON comments. --- indra/llcharacter/lljoint.cpp | 24 ++---------------------- indra/newview/llpanelobject.cpp | 15 --------------- indra/newview/llskinningutil.cpp | 4 ++-- indra/newview/llviewermessage.cpp | 1 - indra/newview/llviewerobject.cpp | 2 +- indra/newview/llvoavatar.cpp | 21 +++++++-------------- 6 files changed, 12 insertions(+), 55 deletions(-) (limited to 'indra/llcharacter/lljoint.cpp') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 07fcd99701..e2f512f86e 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -428,26 +428,6 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh { return; } - // BENTO - // Not clear pelvis overrides are meaningful/useful. - //if (mName == "mPelvis") - //{ - // return; - //} - -#if 0 // AXON MAINT-8554 - this may be overly restrictive for large models - LLVector3 constrained_pos = LLVector3(llclamp(pos[0],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), - llclamp(pos[1],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), - llclamp(pos[2],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET)); - if (constrained_pos != pos) - { - LL_DEBUGS("Avatar") << mesh_id << " joint " << getName() << " attachment pos override constrained to " - << constrained_pos << " was " << pos << LL_ENDL; - } -#else - LLVector3 constrained_pos = pos; -#endif - LLVector3 before_pos; LLUUID before_mesh_id; bool has_active_override_before = hasAttachmentPosOverride( before_pos, before_mesh_id ); @@ -459,7 +439,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh } m_posBeforeOverrides = getPosition(); } - m_attachmentPosOverrides.add(mesh_id,constrained_pos); + m_attachmentPosOverrides.add(mesh_id,pos); LLVector3 after_pos; LLUUID after_mesh_id; hasAttachmentPosOverride(after_pos, after_mesh_id); @@ -468,7 +448,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh active_override_changed = true; if (do_debug_joint(getName())) { - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << constrained_pos << LL_ENDL; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL; } updatePos(av_info); } diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index ed7017bd5c..25cfb598e7 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -342,24 +342,9 @@ void LLPanelObject::getState( ) } // can move or rotate only linked group with move permissions, or sub-object with move and modify perms -#if 0 - // AXON REVIEW BEFORE RELEASE, behavior during edit is glitchy. - // it's not entirely clear what the motivation is to have 3 - // different rules for enablement. At least the difference between - // move and rotate looks like just a parens error, have updated accordingly. - BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && - ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && - ((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts")); - BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && - ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify(); - BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && - ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && - ((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts")); -#else BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify(); BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); -#endif S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )) diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 3d6b0ed957..0fa4c2b114 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -317,7 +317,7 @@ void LLSkinningUtil::updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *a LLVector4 wght; S32 idx[4]; F32 scale = 0.0f; - // AXON unpacking of weights should be pulled into a common function and optimized if possible. + // FIXME unpacking of weights should be pulled into a common function and optimized if possible. for (U32 k = 0; k < 4; k++) { F32 w = weights[k]; @@ -342,7 +342,7 @@ void LLSkinningUtil::updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *a { rig_info_tab[joint_num].setIsRiggedTo(true); - // AXON can precompute these matMuls. + // FIXME could precompute these matMuls. LLMatrix4a bind_shape; bind_shape.loadu(skin->mBindShapeMatrix); LLMatrix4a inv_bind; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 413596a514..dc11bc28e5 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3995,7 +3995,6 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) } -// AXON make logging less spammy after issues resolved, before release. void process_object_animation(LLMessageSystem *mesgsys, void **user_data) { LLUUID animation_id; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a731a39bd6..f963f8a0c8 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3720,7 +3720,7 @@ F32 LLViewerObject::recursiveGetEstTrianglesMax() const S32 LLViewerObject::getAnimatedObjectMaxTris() const { S32 max_tris = 0; - if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits")) // AXON REMOVE AFTER SERVER TESTING DONE + if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits")) { max_tris = S32_MAX; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 127dfe7c60..dba99c7e98 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1300,7 +1300,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) S32 box_detail = gSavedSettings.getS32("AvatarBoundingBoxComplexity"); - // AXON the update_min_max function used below assumes there is a + // FIXME the update_min_max function used below assumes there is a // known starting point, but in general there isn't. Ideally the // box update logic should be modified to handle the no-point-yet // case. For most models, starting with the pelvis is safe though. @@ -1361,7 +1361,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) attachment_iter != attachment->mAttachedObjects.end(); ++attachment_iter) { - // AXON Don't we need to look at children of attached_object as well? + // Don't we need to look at children of attached_object as well? const LLViewerObject* attached_object = (*attachment_iter); if (attached_object && !attached_object->isHUDAttachment()) { @@ -1418,8 +1418,8 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) // Stretch bounding box by rigged mesh joint boxes if (box_detail>=3) { - // AXON try to cache unless something has changed about attached rigged meshes. - // Needs more logic based on volume states. + // FIXME could try to cache unless something has changed about attached rigged meshes, + // but needs more logic based on volume states. //if (mRiggingInfoTab.needsUpdate()) { @@ -5962,13 +5962,6 @@ void LLVOAvatar::rebuildAttachmentOverrides() // ----------------------------------------------------------------------------- void LLVOAvatar::updateAttachmentOverrides() { - const bool paranoid_checking = false; // AXON remove when testing done - - if (paranoid_checking) - { - //dumpArchetypeXML(getFullname() + "_paranoid_before"); - } - LLScopedContextString str("updateAttachmentOverrides " + getFullname()); LL_DEBUGS("AnimatedObjects") << "updating" << LL_ENDL; @@ -6023,7 +6016,7 @@ void LLVOAvatar::updateAttachmentOverrides() } - if (paranoid_checking) +#ifdef ATTACHMENT_OVERRIDE_VALIDATION { std::vector pos_overrides_by_joint; std::vector scale_overrides_by_joint; @@ -6074,9 +6067,10 @@ void LLVOAvatar::updateAttachmentOverrides() } if (mismatched) { - LL_WARNS() << "MISMATCHED ATTACHMENT OVERRIDES, compare paranoid log files" << LL_ENDL; + LL_WARNS() << "MISMATCHED ATTACHMENT OVERRIDES" << LL_ENDL; } } +#endif } //----------------------------------------------------------------------------- @@ -7027,7 +7021,6 @@ U32 LLVOAvatar::getNumAnimatedObjectAttachments() const S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const { S32 max_attach = 0; - // AXON REMOVE AFTER SERVER TESTING DONE if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits")) { max_attach = MAX_AGENT_ATTACHMENTS; -- cgit v1.3