diff options
author | prep linden <prep@lindenlab.com> | 2011-01-12 16:11:51 -0500 |
---|---|---|
committer | prep linden <prep@lindenlab.com> | 2011-01-12 16:11:51 -0500 |
commit | c5de64467f33fef564f930dea156f22d59631c19 (patch) | |
tree | 26a1e4713676e603c92a2b8df74fb2360c502b08 | |
parent | 86482ce1d7dbd01e1ebad4d18565bd979a11aa30 (diff) |
Fix for Sh-780 and tweak for nametag height (Sh-638).
-rw-r--r-- | indra/newview/llvoavatar.cpp | 35 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 1 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 23 |
3 files changed, 34 insertions, 25 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5f0b197510..b667dc1af0 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -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; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index ce5ce045b9..7ef35178ca 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -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);
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 5d1020fce8..3c66c4860e 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -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 |