From 2e0a8231d2ab9be0300083cb3d793bf57fcfb793 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 25 Sep 2014 17:37:46 -0400 Subject: Simple viewer-side hack to adjust avatar position --- indra/newview/app_settings/settings.xml | 15 +++++++++++++++ indra/newview/llvoavatar.cpp | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 000362ebfd..bd035899d0 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -654,6 +654,21 @@ Value 2 + AvatarPosFinalOffset + + Comment + After-everything-else fixup for avatar position. + Persist + 1 + Type + Vector3 + Value + + 0.0 + 0.0 + 0.0 + + AvatarPickerURL Comment diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9f42776d78..dd7d42ee25 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3412,9 +3412,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; + root_pos += LLVector3d(gSavedSettings.getVector3("AvatarPosFinalOffset")); LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); + if (newPosition != mRoot->getXform()->getWorldPosition()) { mRoot->touch(); @@ -3580,7 +3582,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } else if (mDrawable.notNull()) { - mRoot->setPosition(mDrawable->getPosition()); + LLVector3 pos = mDrawable->getPosition(); + pos += gSavedSettings.getVector3("AvatarPosFinalOffset"); + mRoot->setPosition(pos); mRoot->setRotation(mDrawable->getRotation()); } -- cgit v1.2.3