From 7f1a194ccf3f579de886bbbd157f78706829aa73 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 30 Apr 2010 03:01:49 -0700 Subject: Improved accuracy of avatar height calculation. Uses values from SNOW-197 as they seem more accurate. (Plus some code cleanup and compile fixes from Jacek.) --- linden/indra/newview/llfloatercustomize.cpp | 16 +++++++++++----- .../skins/default/xui/en-us/floater_customize.xml | 15 ++++++++++----- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/llfloatercustomize.cpp b/linden/indra/newview/llfloatercustomize.cpp index bfca034..4761491 100644 --- a/linden/indra/newview/llfloatercustomize.cpp +++ b/linden/indra/newview/llfloatercustomize.cpp @@ -1230,13 +1230,19 @@ void LLScrollingPanelParam::onSliderMoved(LLUICtrl* ctrl, void* userdata) LLFloaterCustomize* floater_customize = gFloaterCustomize; if (!floater_customize) return; - //avatar height stuff -Patrick Sapinski (Wednesday, August 19, 2009) + //avatar height stuff + // Use the values in SNOW-197 as they seem more accurate -- MC LLVOAvatar* avatar = gAgent.getAvatarObject(); - F32 avatar_size = (avatar->mBodySize.mV[VZ]) + (F32)0.17; //mBodySize is actually quite a bit off. + //mBodySize is actually quite a bit off. + F32 avatar_size = (avatar->mBodySize.mV[VZ]) + (F32)0.195; + int inches = (int)(avatar_size / .0254f); + int feet = inches / 12; + inches %= 12; - floater_customize->getChild("HeightText")->setValue(llformat("%.2f", avatar_size) + "m"); - floater_customize->getChild("HeightText2")->setValue(llformat("%.2f",llround(avatar_size / 0.3048)) + "'" - + llformat("%.2f",llround(avatar_size * 39.37) % 12) + "\""); + floater_customize->getChild("HeightText")->\ + setValue(llformat("%.2f", avatar_size) + "m"); + floater_customize->getChild("HeightText2")->\ + setValue(llformat("%.2f' %.2f\"", feet, inches)); gAgent.getAvatarObject()->setVisualParamWeight( param, new_weight, FALSE); gAgent.getAvatarObject()->updateVisualParams(); diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml b/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml index b4710be..e947ecd 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_customize.xml @@ -1115,24 +1115,29 @@ scratch and wear it. + left="4" mouse_opaque="true" name="AvatarHeightText" v_pad="0" width="140"> Avatar Height: + left="4" mouse_opaque="true" name="HeightText" v_pad="0" width="140"> Avatar Height + left="4" mouse_opaque="true" name="HeightText2" v_pad="0" width="140"> Avatar Height2 + + (includes shoes) + - -