Fix for Sh-780 and tweak for nametag height (Sh-638).

master
prep linden 2011-01-12 16:11:51 -05:00
parent 86482ce1d7
commit c5de64467f
3 changed files with 34 additions and 25 deletions

View File

@ -3204,8 +3204,8 @@ LLVector3 LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last)
local_camera_at.scaleVec(mBodySize * 0.5f);
LLVector3 name_position = mRoot.getWorldPosition();
name_position[VZ] -= mPelvisToFoot;
name_position[VZ] += (mBodySize[VZ]* 0.5f);
name_position[VZ] -= mPelvisToFoot;
name_position[VZ] += (mBodySize[VZ]* 0.55f);
name_position += (local_camera_up * root_rot) - (projected_vec(local_camera_at * root_rot, camera_to_av));
name_position += pixel_up_vec * 15.f;
@ -6027,6 +6027,34 @@ void LLVOAvatar::rebuildRiggedAttachments( void )
}
}
//-----------------------------------------------------------------------------
// cleanupAttachedMesh()
//-----------------------------------------------------------------------------
void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
{
//If a VO has a skin that we'll reset the joint positions to their default
if ( pVO && pVO->mDrawable )
{
LLVOVolume* pVObj = pVO->mDrawable->getVOVolume();
if ( pVObj )
{
const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID() );
if ( pSkinData )
{
const int jointCnt = pSkinData->mJointNames.size();
bool fullRig = ( jointCnt>=20 ) ? true : false;
if ( fullRig )
{
const int bindCnt = pSkinData->mAlternateBindMatrix.size();
if ( bindCnt > 0 )
{
LLVOAvatar::resetJointPositionsToDefault();
}
}
}
}
}
}
//-----------------------------------------------------------------------------
// detachObject()
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
@ -6036,9 +6064,10 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
++iter)
{
LLViewerJointAttachment* attachment = iter->second;
if (attachment->isObjectAttached(viewer_object))
{
cleanupAttachedMesh( viewer_object );
attachment->removeObject(viewer_object);
lldebugs << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << llendl;
return TRUE;

View File

@ -687,6 +687,7 @@ public:
void clampAttachmentPositions();
virtual const LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object);
virtual BOOL detachObject(LLViewerObject *viewer_object);
void cleanupAttachedMesh( LLViewerObject* pVO );
static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj);
protected:
LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object);

View File

@ -1150,28 +1150,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
const LLUUID attachment_id = viewer_object->getAttachmentItemID();
if ( LLVOAvatar::detachObject(viewer_object) )
{
//If a VO has a skin that we'll reset the joint positions to their default
if ( viewer_object->mDrawable )
{
LLVOVolume* pVObj = viewer_object->mDrawable->getVOVolume();
if ( pVObj )
{
const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID() );
if ( pSkinData )
{
const int jointCnt = pSkinData->mJointNames.size();
bool fullRig = ( jointCnt>=20 ) ? true : false;
if ( fullRig )
{
const int bindCnt = pSkinData->mAlternateBindMatrix.size();
if ( bindCnt > 0 )
{
LLVOAvatar::resetJointPositionsToDefault();
}
}
}
}
}
LLVOAvatar::cleanupAttachedMesh( viewer_object );
// the simulator should automatically handle permission revocation