From 6199cecd8bd40e9929f1863fcfa8220ccf9fdf3b Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 11 Dec 2017 21:18:05 +0000
Subject: [PATCH] SL-704 - more comment review/cleanup, some avatar state
 handling updated for animated objects.

---
 indra/newview/llcontrolavatar.cpp | 7 +++++--
 indra/newview/llvoavatar.cpp      | 9 +++------
 indra/newview/llvovolume.cpp      | 9 ++++-----
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 0f4898e8d3c..9b7118d9cb2 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -113,7 +113,7 @@ void LLControlAvatar::setGlobalScale(F32 scale)
     {
         F32 adjust_scale = scale/mGlobalScale;
         LL_INFOS() << "scale " << scale << " adjustment " << adjust_scale << LL_ENDL;
-        // AXON - should we be scaling from the pelvis or the root?
+        // should we be scaling from the pelvis or the root?
         recursiveScaleJoint(mPelvisp,adjust_scale);
         mGlobalScale = scale;
     }
@@ -167,7 +167,10 @@ void LLControlAvatar::updateVolumeGeom()
 
     matchVolumeTransform();
 
-    // AXON testing scale
+    // Initial exploration of allowing scaling skeleton to match root
+    // prim bounding box. If enabled, would probably be controlled by
+    // an additional checkbox and default to off. Not enabled for
+    // initial release.
 
     // What should the scale be? What we really want is the ratio
     // between the scale at which the object was originally designed
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a5a9fbe0e6c..53db1ffe32a 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3975,7 +3975,6 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w
 		root_pos = gAgent.getPosGlobalFromAgent(getRenderPosition());
 		root_pos.mdV[VZ] += getVisualParamWeight(AVATAR_HOVER);
 
-        // AXON need to review mInAir calcs for animated objects, if the value even matters.
         LLVector3 normal;
 		resolveHeightGlobal(root_pos, ground_under_pelvis, normal);
 		F32 foot_to_ground = (F32) (root_pos.mdV[VZ] - mPelvisToFoot - ground_under_pelvis.mdV[VZ]);				
@@ -4024,9 +4023,8 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w
 		//--------------------------------------------------------------------
 		if (!isControlAvatar() && !isAnyAnimationSignaled(AGENT_NO_ROTATE_ANIMS, NUM_AGENT_NO_ROTATE_ANIMS))
 		{
-            // AXON - should we always skip for control avatars?
-            // Rotation fixups for avatars in motion, some may be
-            // relevant.
+            // Rotation fixups for avatars in motion.
+            // Skip for animated objects.
             updateOrientation(agent, speed, delta_time);
 		}
 	}
@@ -6130,8 +6128,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age
 	LLVector3d z_vec(0.0f, 0.0f, 1.0f);
 	LLVector3d p0_global, p1_global;
 
-    // AXON UPDATE FOR CONTROL AVS?
-	if (mIsDummy)
+	if (isUIAvatar())
 	{
 		outNorm.setVec(z_vec);
 		out_pos_agent = in_pos_agent;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index cdab90d6cf1..61844e064db 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3357,12 +3357,11 @@ U32 LLVOVolume::getExtendedMeshFlags() const
 
 void LLVOVolume::onSetExtendedMeshFlags(U32 flags)
 {
-    // AXON - the check against isAnySelected() is "empirically
-    // derived": doing rebuildGeom() while in selection trashes the
-    // graphics state of animated objects. Skipping this update is OK
-    // because we get another one on deselect.
 
-	if (!getRootEdit()->isAnySelected() && mDrawable.notNull())
+    // The isAnySelected() check was needed at one point to prevent
+    // graphics problems. These are now believed to be fixed so the
+    // check has been disabled.
+	if (/*!getRootEdit()->isAnySelected() &&*/ mDrawable.notNull())
     {
         // Need to trigger rebuildGeom(), which is where control avatars get created/removed
         getRootEdit()->recursiveMarkForUpdate(TRUE);
-- 
GitLab