SH-4240 FIX users can set hover height to 0

removing minimum height enforcement, as changes are local-only and would not
be visible by other users in this repro, unless the user explicitly saved
the changes. Since there are many ways to get around the enforcement, and the
enforced minimums won't be visible to other users, its simpler to allow
users to use the full range of the hover slider.

NOTE: this means that a user's avatar can be underground, leading to the
camera pointing up at the sky. this is a known issue.
meow-7.2.2
Nyx Linden 2013-06-28 11:59:03 -04:00
parent 62a6009fa2
commit 39b734a001
3 changed files with 1 additions and 70 deletions

View File

@ -137,7 +137,7 @@ public:
typedef std::map<std::string, LLJoint*> joint_map_t;
joint_map_t mJointMap;
virtual void computeBodySize();
void computeBodySize();
protected:

View File

@ -5214,72 +5214,6 @@ void LLVOAvatar::updateVisualParams()
updateHeadOffset();
}
/*virtual*/
void LLVOAvatar::computeBodySize()
{
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 1.1 meters (server-enforced limit)
// Camera positioning and other things start to break down when your avatar is "walking" while being fully underground
const LLViewerObject * last_object = NULL;
if (isSelf() && getWearableData() && !LLApp::isQuitting())
{
// Do not force a hover parameter change while we have pending attachments, which may be mesh-based with
// joint offsets.
if (LLAppearanceMgr::instance().getNumAttachmentsInCOF() == getNumAttachments())
{
LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0);
BOOL loaded = TRUE;
for (attachment_map_t::const_iterator points_iter = mAttachmentPoints.begin();
points_iter != mAttachmentPoints.end() && loaded;
++points_iter)
{
const LLViewerJointAttachment *attachment_pt = (*points_iter).second;
if (attachment_pt)
{
for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator attach_iter = attachment_pt->mAttachedObjects.begin(); attach_iter != attachment_pt->mAttachedObjects.end(); attach_iter++)
{
const LLViewerObject* object = (LLViewerObject*)*attach_iter;
if (object)
{
last_object = object;
llwarns << "attachment at point: " << (*points_iter).first << " object exists: " << object->getAttachmentItemID() << llendl;
loaded &=!object->isDrawableState(LLDrawable::REBUILD_ALL);
if (!loaded && shape && !shape->getVolatile())
{
llwarns << "caught unloaded attachment! skipping enforcement" << llendl;
}
}
}
}
}
if (last_object)
{
LL_DEBUGS("Avatar") << "scanned at least one object!" << LL_ENDL;
}
if (loaded && shape && !shape->getVolatile())
{
F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER);
if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f))
{
hover_value = -(mBodySize.mV[VZ] - 1.1f); // avoid floating point rounding making the above check continue to fail.
llassert(mBodySize.mV[VZ] + hover_value >= 1.1f);
hover_value = llmin(hover_value, 0.0f); // don't force the hover value to be greater than 0.
LL_DEBUGS("Avatar") << "changed hover value to: " << hover_value << " from: " << mAvatarOffset.mV[VZ] << LL_ENDL;
mAvatarOffset.mV[VZ] = hover_value;
shape->setVisualParamWeight(AVATAR_HOVER,hover_value, FALSE);
}
}
}
}
}
//-----------------------------------------------------------------------------
// isActive()
//-----------------------------------------------------------------------------

View File

@ -212,9 +212,6 @@ public:
/*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position);
virtual void updateVisualParams();
/*virtual*/ void computeBodySize();
/** Inherited
** **