Decoupled rlva/setting based z-offset from param based z-offset. This reverts questionable changes introduced in the recent rlva merge.

This commit is contained in:
Shyotl
2013-03-27 01:36:23 -05:00
parent 60f1bada3d
commit 92cc65bf5e
7 changed files with 30 additions and 58 deletions

View File

@@ -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()
//-----------------------------------------------------------------------------

View File

@@ -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 &current_volume_num, S32 &current_joint_num);
BOOL allocateCharacterJoints(U32 num);

View File

@@ -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

View File

@@ -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<F32> x_off("AscentAvatarXModifier");
static LLCachedControl<F32> y_off("AscentAvatarYModifier");
static LLCachedControl<F32> 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);

View File

@@ -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)

View File

@@ -3220,21 +3220,27 @@ void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile)
apr_file_printf( file, "\n</wearable_info>\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<F32> x_off("AscentAvatarXModifier");
static LLCachedControl<F32> y_off("AscentAvatarYModifier");
static LLCachedControl<F32> z_off("AscentAvatarZModifier");
LLVector3 offset(x_off,y_off,z_off);
// [RLVa:KB] Custom blah blah
if(rlv_handler_t::isEnabled())
{
static LLCachedControl<F32> x_off("AscentAvatarXModifier");
static LLCachedControl<F32> y_off("AscentAvatarYModifier");
static LLCachedControl<F32> 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)

View File

@@ -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
** **