SH-4146 FIX petite avatars can't touch the ground

adjusted avatar hover limits to make sure that they are not forced to
go above the default
meow-7.2.2
Nyx Linden 2013-04-29 11:49:49 -04:00
parent c198d9db81
commit fcb4f8265d
1 changed files with 10 additions and 1 deletions

View File

@ -491,12 +491,21 @@ void LLAvatarAppearance::computeBodySize()
// Certain configurations of avatars can force the overall height (with offset) to go negative.
// Enforce a constraint to make sure we don't go below 0.1 meters.
// Camera positioning and other things start to break down when your avatar is "walking" while being fully underground
if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 1.1f)
if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 1.1f && mAvatarOffset.mV[VZ] < 0.0f)
{
mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 1.11f); // avoid floating point rounding making the above check continue to fail.
llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 1.1f);
// some mesh avatars force the default height to be less than 1.1 meters. Do not force hover to be positive.
// This will allow them to appear to be on the ground, even if the server forces their physics shape to be
// taller than their visual representation.
if (mAvatarOffset.mV[VZ] > 0.0f)
{
mAvatarOffset.mV[VZ] = 0.0f;
}
if (mWearableData && isSelf())
{
LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0);