Simple viewer-side hack to adjust avatar position

meow-7.2.2
Brad Payne (Vir Linden) 2014-09-25 17:37:46 -04:00
parent b021c90e7b
commit 2e0a8231d2
2 changed files with 20 additions and 1 deletions

View File

@ -654,6 +654,21 @@
<key>Value</key>
<integer>2</integer>
</map>
<key>AvatarPosFinalOffset</key>
<map>
<key>Comment</key>
<string>After-everything-else fixup for avatar position.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Vector3</string>
<key>Value</key>
<array>
<real>0.0</real>
<real>0.0</real>
<real>0.0</real>
</array>
</map>
<key>AvatarPickerURL</key>
<map>
<key>Comment</key>

View File

@ -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());
}