diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 87520bab04..83d96edf26 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -20810,5 +20810,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSLegacyNametagPosition + + Comment + Enables the legacy nametag behavior of staying fixed at the avatar's position instead of following animation movements. + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 705ff96f9f..6c31f0391c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3184,6 +3184,23 @@ void LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) local_camera_up.normalize(); local_camera_up = local_camera_up * inv_root_rot; + // Optional legacy nametag position + LLVector3 name_position; + static LLCachedControl fsLegacyNametagPosition(gSavedSettings, "FSLegacyNametagPosition"); + if (fsLegacyNametagPosition) + { + local_camera_up.scaleVec((mBodySize + mAvatarOffset) * 0.5f); + local_camera_at.scaleVec((mBodySize + mAvatarOffset) * 0.5f); + + name_position = mRoot->getWorldPosition(); + name_position[VZ] -= mPelvisToFoot; + name_position[VZ] += ((mBodySize[VZ] + mAvatarOffset[VZ])* 0.55f); + name_position += (local_camera_up * root_rot) - (projected_vec(local_camera_at * root_rot, camera_to_av)); + name_position += pixel_up_vec * 15.f; + } + else + { + // LLVector3 avatar_ellipsoid(mBodySize.mV[VX] * 0.4f, mBodySize.mV[VY] * 0.4f, mBodySize.mV[VZ] * NAMETAG_VERT_OFFSET_WEIGHT); @@ -3200,9 +3217,14 @@ void LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) mCurRootToHeadOffset = lerp(mCurRootToHeadOffset, mTargetRootToHeadOffset, LLCriticalDamp::getInterpolant(0.2f)); - LLVector3 name_position = mRoot->getLastWorldPosition() + (mCurRootToHeadOffset * root_rot); + // Optional legacy nametag position + //LLVector3 name_position = mRoot->getLastWorldPosition() + (mCurRootToHeadOffset * root_rot); + name_position = mRoot->getLastWorldPosition() + (mCurRootToHeadOffset * root_rot); name_position += (local_camera_up * root_rot) - (projected_vec(local_camera_at * root_rot, camera_to_av)); name_position += pixel_up_vec * NAMETAG_VERTICAL_SCREEN_OFFSET; + // Optional legacy nametag position + } + // // Optional Z-offset correction for name tags static LLCachedControl fsNameTagOffset(gSavedSettings, "FSNameTagZOffsetCorrection"); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index c59b0fee07..03fdda8783 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -406,6 +406,19 @@ + +