diff options
author | Nyx Linden <nyx@lindenlab.com> | 2013-02-28 17:25:37 -0500 |
---|---|---|
committer | Nyx Linden <nyx@lindenlab.com> | 2013-02-28 17:25:37 -0500 |
commit | d1c144519306cae7eff7f781417482c85068988c (patch) | |
tree | b26d8c8d89109cf9a5ec6b1bae374d35a07bde6e /indra/llappearance | |
parent | 998c31ef9e0631eefe07e4e678032ee90c56c859 (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/llappearance')
-rwxr-xr-x | indra/llappearance/llavatarappearance.cpp | 9 | ||||
-rwxr-xr-x | indra/llappearance/llavatarappearance.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 89e64822f8..2d5744bb5e 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -462,6 +462,10 @@ void LLAvatarAppearance::computeBodySize() LLVector3 foot = mFootLeftp->getPosition(); + F32 old_offset = mAvatarOffset.mV[VZ]; + + mAvatarOffset.mV[VZ] = getVisualParamWeight(11001); + mPelvisToFoot = hip.mV[VZ] * pelvis_scale.mV[VZ] - knee.mV[VZ] * hip_scale.mV[VZ] - ankle.mV[VZ] * knee_scale.mV[VZ] - @@ -481,7 +485,10 @@ void LLAvatarAppearance::computeBodySize() new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH; new_body_size.mV[VY] = DEFAULT_AGENT_WIDTH; - if (new_body_size != mBodySize) + mAvatarOffset.mV[VX] = 0.0f; + mAvatarOffset.mV[VY] = 0.0f; + + if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ]) { mBodySize = new_body_size; bodySizeChanged(); diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 11ea5e5a46..bce2540258 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -160,6 +160,7 @@ protected: //-------------------------------------------------------------------- public: LLVector3 mBodySize; + LLVector3 mAvatarOffset; protected: F32 mPelvisToFoot; |