summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorNyx Linden <nyx@lindenlab.com>2013-02-28 17:25:37 -0500
committerNyx Linden <nyx@lindenlab.com>2013-02-28 17:25:37 -0500
commitd1c144519306cae7eff7f781417482c85068988c (patch)
treeb26d8c8d89109cf9a5ec6b1bae374d35a07bde6e /indra/newview
parent998c31ef9e0631eefe07e4e678032ee90c56c859 (diff)
SH-3909 Support avatar height offset
Adding a new visual param that allows users to manually adjust an offset for how far off the ground (+ or -) their avatar's root bone is. Supports the +-2m range people are used to adjusting in their viewers, but new implementation should support server-generated appearances.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/character/avatar_lad.xml17
-rwxr-xr-xindra/newview/llagent.cpp4
-rw-r--r--indra/newview/llcallingcard.cpp3
-rwxr-xr-xindra/newview/llvoavatar.cpp10
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml1
5 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml
index 2b090c4fa4..284e9c44b2 100755
--- a/indra/newview/character/avatar_lad.xml
+++ b/indra/newview/character/avatar_lad.xml
@@ -1084,6 +1084,23 @@
scale="0 0 .5" />
</param_skeleton>
</param>
+
+ <param
+ id="11001"
+ group="0"
+ name="Hover"
+ wearable="shape"
+ edit_group="shape_body"
+ edit_group_order="4"
+ label_min="Lower"
+ label_max="Higher"
+ value_min="-2"
+ value_max="2"
+ value_default="0"
+ camera_distance="2.5">
+ <param_skeleton />
+ </param>
+
</skeleton>
<mesh
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index e15c1a5104..48faeb81e0 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2332,7 +2332,7 @@ void LLAgent::setStartPosition( U32 location_id )
if (isAgentAvatarValid())
{
// the z height is at the agent's feet
- agent_pos.mV[VZ] -= 0.5f * gAgentAvatarp->mBodySize.mV[VZ];
+ agent_pos.mV[VZ] -= 0.5f * (gAgentAvatarp->mBodySize.mV[VZ] + gAgentAvatarp->mAvatarOffset.mV[VZ]);
}
agent_pos.mV[VX] = llclamp( agent_pos.mV[VX], INSET, REGION_WIDTH - INSET );
@@ -4385,7 +4385,7 @@ void LLAgent::sendAgentSetAppearance()
// NOTE -- when we start correcting all of the other Havok geometry
// to compensate for the COLLISION_TOLERANCE ugliness we will have
// to tweak this number again
- const LLVector3 body_size = gAgentAvatarp->mBodySize;
+ const LLVector3 body_size = gAgentAvatarp->mBodySize + gAgentAvatarp->mAvatarOffset;
msg->addVector3Fast(_PREHASH_Size, body_size);
// To guard against out of order packets
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp
index 0d55c4429a..0b8f863e75 100644
--- a/indra/newview/llcallingcard.cpp
+++ b/indra/newview/llcallingcard.cpp
@@ -183,7 +183,8 @@ LLVector3d LLAvatarTracker::getGlobalPos()
global_pos = object->getPositionGlobal();
// HACK - for making the tracker point above the avatar's head
// rather than its groin
- global_pos.mdV[VZ] += 0.7f * ((LLVOAvatar *)object)->mBodySize.mV[VZ];
+ LLVOAvatar* av = (LLVOAvatar*)object;
+ global_pos.mdV[VZ] += 0.7f * (av->mBodySize.mV[VZ] + av->mAvatarOffset.mV[VZ]);
mTrackingData->mGlobalPositionEstimate = global_pos;
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 266b9fecd5..aa90cbc5d2 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2061,7 +2061,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
{
LLVector3 tagPos = mRoot->getWorldPosition();
tagPos[VZ] -= mPelvisToFoot;
- tagPos[VZ] += ( mBodySize[VZ] + 0.125f );
+ tagPos[VZ] += ( mBodySize[VZ] + mAvatarOffset[VZ] + 0.125f );
mVoiceVisualizer->setVoiceSourceWorldPosition( tagPos );
}
}//if ( voiceEnabled )
@@ -2805,12 +2805,12 @@ LLVector3 LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last)
local_camera_up.normalize();
local_camera_up = local_camera_up * ~root_rot;
- local_camera_up.scaleVec(mBodySize * 0.5f);
- local_camera_at.scaleVec(mBodySize * 0.5f);
+ local_camera_up.scaleVec((mBodySize + mAvatarOffset) * 0.5f);
+ local_camera_at.scaleVec((mBodySize + mAvatarOffset) * 0.5f);
LLVector3 name_position = mRoot->getWorldPosition();
name_position[VZ] -= mPelvisToFoot;
- name_position[VZ] += (mBodySize[VZ]* 0.55f);
+ 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;
@@ -3110,6 +3110,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
}
root_pos = gAgent.getPosGlobalFromAgent(getRenderPosition());
+ root_pos.mdV[VZ] += getVisualParamWeight(11001);
+
resolveHeightGlobal(root_pos, ground_under_pelvis, normal);
F32 foot_to_ground = (F32) (root_pos.mdV[VZ] - mPelvisToFoot - ground_under_pelvis.mdV[VZ]);
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 4383b98592..883a06d5e1 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2991,6 +2991,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="Higher">Higher</string>
<string name="Hip Length">Hip Length</string>
<string name="Hip Width">Hip Width</string>
+<string name="Hover">Hover</string>
<string name="In">In</string>
<string name="In Shdw Color">Inner Shadow Color</string>
<string name="In Shdw Opacity">Inner Shadow Opacity</string>