From 6f99c42e93ed5a8370ef25f29212f596c89724c6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Nov 2021 00:02:33 +0200 Subject: SL-13867 Remove unused sFreezeCounter --- indra/newview/llvoavatar.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e085a945a8..d3473e8a3b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -575,7 +575,6 @@ private: //----------------------------------------------------------------------------- // Static Data //----------------------------------------------------------------------------- -S32 LLVOAvatar::sFreezeCounter = 0; U32 LLVOAvatar::sMaxNonImpostors = 12; // Set from RenderAvatarMaxNonImpostors bool LLVOAvatar::sLimitNonImpostors = false; // True unless RenderAvatarMaxNonImpostors is 0 (unlimited) F32 LLVOAvatar::sRenderDistance = 256.f; @@ -4042,8 +4041,7 @@ void LLVOAvatar::computeUpdatePeriod() && (!isSelf() || visually_muted) && !isUIAvatar() && (sLimitNonImpostors || visually_muted) - && !mNeedsAnimUpdate - && !sFreezeCounter) + && !mNeedsAnimUpdate) { const LLVector4a* ext = mDrawable->getSpatialExtents(); LLVector4a size; @@ -10104,23 +10102,6 @@ LLHost LLVOAvatar::getObjectHost() const } } -//static -void LLVOAvatar::updateFreezeCounter(S32 counter) -{ - if(counter) - { - sFreezeCounter = counter; - } - else if(sFreezeCounter > 0) - { - sFreezeCounter--; - } - else - { - sFreezeCounter = 0; - } -} - BOOL LLVOAvatar::updateLOD() { if (mDrawable.isNull()) -- cgit v1.2.3 From 57a7f63dcce6eb20a05dbc42bfdc9ac51072cb7e Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 4 Feb 2022 09:55:05 -0800 Subject: SL-98 - Render a "ground plane" in the model upload preview, so users can see any added offset --- indra/newview/llvoavatar.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5d994058c2..812a5c4fe6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1,4 +1,4 @@ -/** +/** * @File llvoavatar.cpp * @brief Implementation of LLVOAvatar class which is a derivation of LLViewerObject * @@ -1673,6 +1673,36 @@ void LLVOAvatar::renderBones(const std::string &selected_joint) } } +void LLVOAvatar::renderGroundPlane(float z_offset) +{ // Not necesarilly general - beware - but it seems to meet the needs of LLModelPreview::render + LLVector3 root_pos = mRoot->getPosition(); + const LLVector4a* ext = mDrawable->getSpatialExtents(); + auto min = ext[0], max = ext[1]; + auto center = (max - min) * 0.5f; + F32 ground = root_pos[2] - center[2] - z_offset; + + LLVector3 vA{min[0], min[1], ground}; + LLVector3 vB{max[0], min[1], ground}; + LLVector3 vC{max[0], max[1], ground}; + LLVector3 vD{min[0], max[1], ground}; + + gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f ); + + gGL.begin(LLRender::LINES); + gGL.vertex3fv(vA.mV); + gGL.vertex3fv(vB.mV); + + gGL.vertex3fv(vB.mV); + gGL.vertex3fv(vC.mV); + + gGL.vertex3fv(vC.mV); + gGL.vertex3fv(vD.mV); + + gGL.vertex3fv(vD.mV); + gGL.vertex3fv(vA.mV); + + gGL.end(); +} void LLVOAvatar::renderJoints() { -- cgit v1.2.3 From 3397ca14766855091b8fd9391527d381e94793b1 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 4 Feb 2022 12:46:22 -0800 Subject: SL-98 - Guessing at what might make MS compiler happier. --- indra/newview/llvoavatar.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 812a5c4fe6..7123c0e3dd 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1675,16 +1675,16 @@ void LLVOAvatar::renderBones(const std::string &selected_joint) void LLVOAvatar::renderGroundPlane(float z_offset) { // Not necesarilly general - beware - but it seems to meet the needs of LLModelPreview::render - LLVector3 root_pos = mRoot->getPosition(); + const LLVector3 root_pos = mRoot->getPosition(); const LLVector4a* ext = mDrawable->getSpatialExtents(); - auto min = ext[0], max = ext[1]; - auto center = (max - min) * 0.5f; - F32 ground = root_pos[2] - center[2] - z_offset; - - LLVector3 vA{min[0], min[1], ground}; - LLVector3 vB{max[0], min[1], ground}; - LLVector3 vC{max[0], max[1], ground}; - LLVector3 vD{min[0], max[1], ground}; + const LLVector4a min = ext[0], max = ext[1]; + const F32 center = (max[2] - min[2]) * 0.5f; + const F32 ground = root_pos[2] - center - z_offset; + + const LLVector3 vA{min[0], min[1], ground}; + const LLVector3 vB{max[0], min[1], ground}; + const LLVector3 vC{max[0], max[1], ground}; + const LLVector3 vD{min[0], max[1], ground}; gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f ); -- cgit v1.2.3 From f1df486208f94c649f09dc2dc0cce393208d3771 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 4 Feb 2022 13:55:08 -0800 Subject: SL-98 - move new renderGroundPlane from LLVOAvatar to LLModelPreview --- indra/newview/llvoavatar.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7123c0e3dd..7746af5a58 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1673,36 +1673,6 @@ void LLVOAvatar::renderBones(const std::string &selected_joint) } } -void LLVOAvatar::renderGroundPlane(float z_offset) -{ // Not necesarilly general - beware - but it seems to meet the needs of LLModelPreview::render - const LLVector3 root_pos = mRoot->getPosition(); - const LLVector4a* ext = mDrawable->getSpatialExtents(); - const LLVector4a min = ext[0], max = ext[1]; - const F32 center = (max[2] - min[2]) * 0.5f; - const F32 ground = root_pos[2] - center - z_offset; - - const LLVector3 vA{min[0], min[1], ground}; - const LLVector3 vB{max[0], min[1], ground}; - const LLVector3 vC{max[0], max[1], ground}; - const LLVector3 vD{min[0], max[1], ground}; - - gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f ); - - gGL.begin(LLRender::LINES); - gGL.vertex3fv(vA.mV); - gGL.vertex3fv(vB.mV); - - gGL.vertex3fv(vB.mV); - gGL.vertex3fv(vC.mV); - - gGL.vertex3fv(vC.mV); - gGL.vertex3fv(vD.mV); - - gGL.vertex3fv(vD.mV); - gGL.vertex3fv(vA.mV); - - gGL.end(); -} void LLVOAvatar::renderJoints() { -- cgit v1.2.3 From b146de38de69167354da08e37dfd8903f2466f9d Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Tue, 8 Feb 2022 14:59:31 -0800 Subject: SL-98 - Remove dead code --- indra/newview/llvoavatar.cpp | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7746af5a58..f4fa94eade 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -176,8 +176,6 @@ const F32 MAX_STANDOFF_DISTANCE_CHANGE = 32; // Should probably be 4 or 3, but didn't want to change it while change other logic - SJB const S32 SWITCH_TO_BAKED_DISCARD = 5; -const F32 FOOT_COLLIDE_FUDGE = 0.04f; - const F32 HOVER_EFFECT_MAX_SPEED = 3.f; const F32 HOVER_EFFECT_STRENGTH = 0.f; const F32 UNDERWATER_EFFECT_STRENGTH = 0.1f; @@ -600,7 +598,6 @@ S32 LLVOAvatar::sNumVisibleChatBubbles = 0; BOOL LLVOAvatar::sDebugInvisible = FALSE; BOOL LLVOAvatar::sShowAttachmentPoints = FALSE; BOOL LLVOAvatar::sShowAnimationDebug = FALSE; -BOOL LLVOAvatar::sShowFootPlane = FALSE; BOOL LLVOAvatar::sVisibleInFirstPerson = FALSE; F32 LLVOAvatar::sLODFactor = 1.f; F32 LLVOAvatar::sPhysicsLODFactor = 1.f; @@ -5008,42 +5005,6 @@ U32 LLVOAvatar::renderSkinned() return num_indices; } - // render collision normal - // *NOTE: this is disabled (there is no UI for enabling sShowFootPlane) due - // to DEV-14477. the code is left here to aid in tracking down the cause - // of the crash in the future. -brad - if (sShowFootPlane && mDrawable.notNull()) - { - LLVector3 slaved_pos = mDrawable->getPositionAgent(); - LLVector3 foot_plane_normal(mFootPlane.mV[VX], mFootPlane.mV[VY], mFootPlane.mV[VZ]); - F32 dist_from_plane = (slaved_pos * foot_plane_normal) - mFootPlane.mV[VW]; - LLVector3 collide_point = slaved_pos; - collide_point.mV[VZ] -= foot_plane_normal.mV[VZ] * (dist_from_plane + COLLISION_TOLERANCE - FOOT_COLLIDE_FUDGE); - - gGL.begin(LLRender::LINES); - { - F32 SQUARE_SIZE = 0.2f; - gGL.color4f(1.f, 0.f, 0.f, 1.f); - - gGL.vertex3f(collide_point.mV[VX] - SQUARE_SIZE, collide_point.mV[VY] - SQUARE_SIZE, collide_point.mV[VZ]); - gGL.vertex3f(collide_point.mV[VX] + SQUARE_SIZE, collide_point.mV[VY] - SQUARE_SIZE, collide_point.mV[VZ]); - - gGL.vertex3f(collide_point.mV[VX] + SQUARE_SIZE, collide_point.mV[VY] - SQUARE_SIZE, collide_point.mV[VZ]); - gGL.vertex3f(collide_point.mV[VX] + SQUARE_SIZE, collide_point.mV[VY] + SQUARE_SIZE, collide_point.mV[VZ]); - - gGL.vertex3f(collide_point.mV[VX] + SQUARE_SIZE, collide_point.mV[VY] + SQUARE_SIZE, collide_point.mV[VZ]); - gGL.vertex3f(collide_point.mV[VX] - SQUARE_SIZE, collide_point.mV[VY] + SQUARE_SIZE, collide_point.mV[VZ]); - - gGL.vertex3f(collide_point.mV[VX] - SQUARE_SIZE, collide_point.mV[VY] + SQUARE_SIZE, collide_point.mV[VZ]); - gGL.vertex3f(collide_point.mV[VX] - SQUARE_SIZE, collide_point.mV[VY] - SQUARE_SIZE, collide_point.mV[VZ]); - - gGL.vertex3f(collide_point.mV[VX], collide_point.mV[VY], collide_point.mV[VZ]); - gGL.vertex3f(collide_point.mV[VX] + mFootPlane.mV[VX], collide_point.mV[VY] + mFootPlane.mV[VY], collide_point.mV[VZ] + mFootPlane.mV[VZ]); - - } - gGL.end(); - gGL.flush(); - } //-------------------------------------------------------------------- // render all geometry attached to the skeleton //-------------------------------------------------------------------- -- cgit v1.2.3 From 28ae135375c42d6cfd89fc8d68cd80f4685b93eb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 14 May 2022 01:11:08 +0300 Subject: SL-16746 Hide hair and fix missing light for animation preview --- indra/newview/llvoavatar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 249fae5441..c5c1c3b57a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7144,6 +7144,14 @@ LLViewerJoint* LLVOAvatar::getViewerJoint(S32 idx) return dynamic_cast(mMeshLOD[idx]); } +//----------------------------------------------------------------------------- +// hideHair() +//----------------------------------------------------------------------------- +void LLVOAvatar::hideHair() +{ + mMeshLOD[MESH_ID_HAIR]->setVisible(FALSE, TRUE); +} + //----------------------------------------------------------------------------- // hideSkirt() //----------------------------------------------------------------------------- -- cgit v1.2.3 From d2e242ab632a051e0b357efa1fdd0a1a64027f44 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 16 May 2022 18:28:06 +0300 Subject: SL-17412 Crash at isWearingWearableType Related to "Allow Select Avatar" feature, selection manager made avatar to persist longer. --- indra/newview/llvoavatar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c5c1c3b57a..df34dda65e 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -763,6 +763,13 @@ std::string LLVOAvatar::avString() const void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) { + if (gDisconnected) + { + // If we disconected, these values are likely to be invalid and + // avString() might crash due to a dead sAvatarDictionary + return; + } + LL_INFOS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ]" << avString() -- cgit v1.2.3 From f7edcab9c3187a2dc797db614ba0302ed7eed578 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 7 Dec 2018 21:27:12 +0000 Subject: SL-288, SL-10163 - allow joint aliases, but otherwise reject upload of animations containing invalid joint names # Conflicts: # indra/newview/llviewerassetupload.cpp # indra/newview/llvoavatar.cpp --- indra/newview/llvoavatar.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d421b3b1f6..487730e209 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6145,8 +6145,17 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) LLJoint* jointp = NULL; if (iter == mJointMap.end() || iter->second == NULL) - { //search for joint and cache found joint in lookup table - jointp = mRoot->findJoint(name); + joint_alias_map_t::const_iterator alias_iter = mJointAliasMap.find(name); + std::string canonical_name; + if (alias_iter != mJointAliasMap.end()) + { + canonical_name = alias_iter->second; + } + else + { + canonical_name = name; + } + jointp = mRoot->findJoint(canonical_name); mJointMap[name] = jointp; } else -- cgit v1.2.3 From 4413f9be879c14328988ce4d285c1dfa263db027 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 10 Dec 2018 15:02:41 +0000 Subject: SL-288, SL-10163 - error reporting for animation upload failures. --- indra/newview/llvoavatar.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 487730e209..b1f04601fd 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6145,6 +6145,7 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) LLJoint* jointp = NULL; if (iter == mJointMap.end() || iter->second == NULL) + { joint_alias_map_t::const_iterator alias_iter = mJointAliasMap.find(name); std::string canonical_name; if (alias_iter != mJointAliasMap.end()) -- cgit v1.2.3 From 307db06310d6d3dc5a38da5543d0f074266fb12a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 6 Dec 2018 21:58:14 +0000 Subject: SL-10163 - allow joint aliases in animation uploads. Names are canonicalized before sending to simulator. # Conflicts: # indra/newview/llviewerassetupload.cpp # indra/newview/llvoavatar.cpp # scripts/content_tools/anim_tool.py --- indra/newview/llvoavatar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b1f04601fd..8c8025e352 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6145,7 +6145,11 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) LLJoint* jointp = NULL; if (iter == mJointMap.end() || iter->second == NULL) - { + { //search for joint and cache found joint in lookup table + if (mJointAliasMap.empty()) + { + getJointAliases(); + } joint_alias_map_t::const_iterator alias_iter = mJointAliasMap.find(name); std::string canonical_name; if (alias_iter != mJointAliasMap.end()) -- cgit v1.2.3 From 4cfa59d3f1b856f62ab18543b1dbefbc574fb218 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 26 May 2022 21:25:23 +0300 Subject: SL-17473 Viewer not clearing all Vertex Buffers in some cases Image thread doesn't need mBuffer and buffer isn't thread safe so no point allocating it in an image thread. --- indra/newview/llvoavatar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 37851ce99b..5dfcb68562 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2810,6 +2810,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) if (detailed_update) { U32 draw_order = 0; + S32 attachment_selected = LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment(); for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -2849,7 +2850,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) } // if selecting any attachments, update all of them as non-damped - if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment()) + if (attachment_selected) { gPipeline.updateMoveNormalAsync(attached_object->mDrawable); } -- cgit v1.2.3 From b6e8596cd93268f0c7139cb1efa5919bf989463a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 7 Jul 2022 22:59:34 +0300 Subject: SL-16598 Stuck in Ground Sit 'Sitting' motion was in a loading state, but not active, which resulted in viewer dropping 'sitting' state --- indra/newview/llvoavatar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 314c22eb6c..5c76f7b392 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4619,7 +4619,12 @@ bool LLVOAvatar::updateCharacter(LLAgent &agent) } else if (!getParent() && isSitting() && !isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED)) { - getOffObject(); + // If we are starting up, motion might be loading + LLMotion *motionp = mMotionController.findMotion(ANIM_AGENT_SIT_GROUND_CONSTRAINED); + if (!motionp || !mMotionController.isMotionLoading(motionp)) + { + getOffObject(); + } } //-------------------------------------------------------------------- -- cgit v1.2.3