From 92cc65bf5e29ddeb7d4efbe672fc2ad221bda98b Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 27 Mar 2013 01:36:23 -0500 Subject: [PATCH] Decoupled rlva/setting based z-offset from param based z-offset. This reverts questionable changes introduced in the recent rlva merge. --- indra/llappearance/llavatarappearance.cpp | 16 +++---------- indra/llappearance/llavatarappearance.h | 3 --- indra/newview/ascentprefsvan.cpp | 8 +++---- indra/newview/llagent.cpp | 18 +-------------- indra/newview/llviewermenu.cpp | 9 +++----- indra/newview/llvoavatarself.cpp | 28 ++++++++++++++--------- indra/newview/llvoavatarself.h | 6 ++--- 7 files changed, 30 insertions(+), 58 deletions(-) diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 0d92e4885..385546798 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -465,10 +465,7 @@ void LLAvatarAppearance::computeBodySize() LLVector3 old_offset = mAvatarOffset; -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) - mAvatarOffset = getAvatarOffset(); -// [/RLVa:KB] -// mAvatarOffset.mV[VZ] = getVisualParamWeight(11001); + mAvatarOffset.mV[VZ] = getVisualParamWeight(11001); mPelvisToFoot = hip.mV[VZ] * pelvis_scale.mV[VZ] - knee.mV[VZ] * hip_scale.mV[VZ] - @@ -489,8 +486,8 @@ void LLAvatarAppearance::computeBodySize() new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH; new_body_size.mV[VY] = DEFAULT_AGENT_WIDTH; - //mAvatarOffset.mV[VX] = 0.0f; - //mAvatarOffset.mV[VY] = 0.0f; + mAvatarOffset.mV[VX] = 0.0f; + mAvatarOffset.mV[VY] = 0.0f; if (new_body_size != mBodySize || old_offset != mAvatarOffset) { @@ -499,13 +496,6 @@ void LLAvatarAppearance::computeBodySize() } } -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) -LLVector3 LLAvatarAppearance::getAvatarOffset() /*const*/ -{ - return LLVector3(0.f,0.f,getVisualParamWeight(11001)); -} -// [/RLVa:KB] - //----------------------------------------------------------------------------- // parseSkeletonFile() //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 1882e2582..93758b54c 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -150,9 +150,6 @@ protected: virtual void buildCharacter(); virtual BOOL loadAvatar(); virtual void bodySizeChanged() = 0; -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) - virtual LLVector3 getAvatarOffset() /*const*/; -// [/RLVa:KB] BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); BOOL allocateCharacterJoints(U32 num); diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index b61fe28d4..34273a963 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -116,10 +116,10 @@ void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata) //static void LLPrefsAscentVan::onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata) { - if (!gAgent.getID().isNull()) - { - gAgent.sendAgentSetAppearance(); - } + //if (!gAgent.getID().isNull()) + //{ + // gAgent.sendAgentSetAppearance(); + //} } //static diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 84d9c7fd7..2610a2732 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4527,23 +4527,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 - LLVector3 body_size = gAgentAvatarp->mBodySize + gAgentAvatarp->mAvatarOffset; - - static LLCachedControl x_off("AscentAvatarXModifier"); - static LLCachedControl y_off("AscentAvatarYModifier"); - static LLCachedControl z_off("AscentAvatarZModifier"); - - body_size.mV[VX] += x_off; - body_size.mV[VY] += y_off; -// [RLVa:KB] - Checked: 2010-10-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e - if (rlv_handler_t::isEnabled()) - { - F32 rlvz_off = RlvSettings::getAvatarOffsetZ(); - body_size.mV[VZ] += fabs(rlvz_off) ? rlvz_off : z_off; - } - else -// [/RLVa:KB] - body_size.mV[VZ] += z_off; + LLVector3 body_size = gAgentAvatarp->mBodySize + gAgentAvatarp->getLegacyAvatarOffset(); msg->addVector3Fast(_PREHASH_Size, body_size); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 38bc05235..90b3e7630 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -454,15 +454,12 @@ bool on_pose_stand; void set_current_pose(std::string anim) { - if (!on_pose_stand) - { - on_pose_stand = true; - gSavedSettings.setF32("AscentAvatarZModifier", gSavedSettings.getF32("AscentAvatarZModifier") + 7.5); - } + on_pose_stand = true; gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose.set(anim); gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_START); + gAgent.sendAgentSetAppearance(); } void handle_pose_stand(void*) { @@ -472,10 +469,10 @@ void handle_pose_stand_stop(void*) { if (on_pose_stand) { - gSavedSettings.setF32("AscentAvatarZModifier", gSavedSettings.getF32("AscentAvatarZModifier") - 7.5); on_pose_stand = false; gAgent.sendAnimationRequest(current_pose, ANIM_REQUEST_STOP); current_pose = LLUUID::null; + gAgent.sendAgentSetAppearance(); } } void cleanup_pose_stand(void) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 60f463c71..b5344c16c 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -3220,21 +3220,27 @@ void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile) apr_file_printf( file, "\n\n" ); } - -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) -LLVector3 LLVOAvatarSelf::getAvatarOffset() /*const*/ +extern bool on_pose_stand; +LLVector3 LLVOAvatarSelf::getLegacyAvatarOffset() const { - if(isUsingServerBakes()) - return LLAvatarAppearance::getAvatarOffset(); - else + static LLCachedControl x_off("AscentAvatarXModifier"); + static LLCachedControl y_off("AscentAvatarYModifier"); + static LLCachedControl z_off("AscentAvatarZModifier"); + LLVector3 offset(x_off,y_off,z_off); + +// [RLVa:KB] Custom blah blah + if(rlv_handler_t::isEnabled()) { - static LLCachedControl x_off("AscentAvatarXModifier"); - static LLCachedControl y_off("AscentAvatarYModifier"); - static LLCachedControl z_off("AscentAvatarZModifier"); - return LLVector3(x_off,y_off,z_off+RlvSettings::getAvatarOffsetZ()); + F32 rlva_z_offs = RlvSettings::getAvatarOffsetZ(); + if(fabs(rlva_z_offs) > F_APPROXIMATELY_ZERO) + offset.mV[VZ] = rlva_z_offs; } -} // [/RLVa:KB] + if(on_pose_stand) + offset.mV[VZ] += 7.5f; + + return offset; +} // static void LLVOAvatarSelf::onChangeSelfInvisible(bool invisible) diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index b5a15ec9d..62108b416 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -355,10 +355,8 @@ public: public: bool sendAppearanceMessage(LLMessageSystem *mesgsys) const; -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) -protected: - /*virtual*/ LLVector3 getAvatarOffset() /*const*/; -// [/RLVa:KB] +public: + LLVector3 getLegacyAvatarOffset() const; /** Appearance ** **