From 2e0a8231d2ab9be0300083cb3d793bf57fcfb793 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 25 Sep 2014 17:37:46 -0400 Subject: Simple viewer-side hack to adjust avatar position --- indra/newview/llvoavatar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9f42776d78..dd7d42ee25 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3412,9 +3412,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; + root_pos += LLVector3d(gSavedSettings.getVector3("AvatarPosFinalOffset")); LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); + if (newPosition != mRoot->getXform()->getWorldPosition()) { mRoot->touch(); @@ -3580,7 +3582,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } else if (mDrawable.notNull()) { - mRoot->setPosition(mDrawable->getPosition()); + LLVector3 pos = mDrawable->getPosition(); + pos += gSavedSettings.getVector3("AvatarPosFinalOffset"); + mRoot->setPosition(pos); mRoot->setRotation(mDrawable->getRotation()); } -- cgit v1.2.3 From c9981ec59c4613531b2d5bb03f6ab8f6d914343c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 8 Dec 2014 13:12:28 -0500 Subject: SL-92 WIP - hover height communicated via appearance messages. --- indra/newview/llvoavatar.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2c1dedede0..d150ace455 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -252,6 +252,8 @@ struct LLAppearanceMessageContents //U32 appearance_flags = 0; std::vector mParamWeights; std::vector mParams; + LLVector3 mHoverOffset; + bool mHoverOffsetWasSet; }; struct LLVOAvatarChildJoint : public LLInitParam::ChoiceBlock @@ -717,7 +719,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), mLastUpdateRequestCOFVersion(-1), - mLastUpdateReceivedCOFVersion(-1) + mLastUpdateReceivedCOFVersion(-1), + mHoverOffset(0.0, 0.0, 0.0) { //VTResume(); // VTune @@ -1959,6 +1962,11 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, // Do base class updates... U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp); + //LLTEContents tec; + //S32 te_retval = parseTEMessage(mesgsys, _PREHASH_ObjectData, block_num, tec); + + LL_DEBUGS("Avatar") << avString() << update_type << LL_ENDL; + // Print out arrival information once we have name of avatar. if (has_name && getNVPair("FirstName")) { @@ -3411,7 +3419,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; - root_pos += LLVector3d(gSavedSettings.getVector3("AvatarPosFinalOffset")); + root_pos += LLVector3d(mHoverOffset); LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); @@ -3581,7 +3589,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) else if (mDrawable.notNull()) { LLVector3 pos = mDrawable->getPosition(); - pos += gSavedSettings.getVector3("AvatarPosFinalOffset"); + pos += mHoverOffset; mRoot->setPosition(pos); mRoot->setRotation(mDrawable->getRotation()); } @@ -7007,6 +7015,17 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe // For future use: //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); } + + // Parse the AppearanceData field, if any. + contents.mHoverOffsetWasSet = false; + if (mesgsys->has(_PREHASH_AppearanceHover)) + { + LLVector3 hover; + mesgsys->getVector3Fast(_PREHASH_AppearanceHover, _PREHASH_HoverHeight, hover); + LL_DEBUGS("Avatar") << avString() << " hover received " << hover.mV[ VX ] << "," << hover.mV[ VY ] << "," << hover.mV[ VZ ] << LL_ENDL; + contents.mHoverOffset = hover; + contents.mHoverOffsetWasSet = true; + } // Parse visual params, if any. S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); @@ -7308,6 +7327,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } + if (contents.mHoverOffsetWasSet) + { + mHoverOffset = contents.mHoverOffset; + } + setCompositeUpdatesEnabled( TRUE ); // If all of the avatars are completely baked, release the global image caches to conserve memory. -- cgit v1.2.3 From a357a4096cb645956a2432adfd5dcadc55c153f5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Dec 2014 16:33:34 -0500 Subject: SL-92 WIP --- indra/newview/llvoavatar.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d150ace455..118ed10eb2 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3219,6 +3219,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { debug_line += llformat(" - cof rcv:%d", last_received_cof_version); } + if (mHoverOffset[2] != 0.0) + { + debug_line += llformat(" hov_z: %f", mHoverOffset[2]); + } addDebugText(debug_line); } if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) @@ -3589,7 +3593,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) else if (mDrawable.notNull()) { LLVector3 pos = mDrawable->getPosition(); - pos += mHoverOffset; + pos += mHoverOffset * mDrawable->getRotation(); mRoot->setPosition(pos); mRoot->setRotation(mDrawable->getRotation()); } @@ -7327,11 +7331,22 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } - if (contents.mHoverOffsetWasSet) + if (contents.mHoverOffsetWasSet && !isSelf()) { + // Got an update for some other avatar. + // (Ignore updates for self because they may be out of date.) mHoverOffset = contents.mHoverOffset; } + if (!contents.mHoverOffsetWasSet) + { + // If we don't get a value at all, we are presumably in a + // region that does not support hover height. +// FIXME RESTORE AFTER TESTING + LL_WARNS() << "zeroing hover because not defined in appearance message" << LL_ENDL; + mHoverOffset = LLVector3(0.0, 0.0, 0.0); + } + setCompositeUpdatesEnabled( TRUE ); // If all of the avatars are completely baked, release the global image caches to conserve memory. -- cgit v1.2.3 From 6539fe4a671ae73badc3aea6e00d497daafc7733 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 16 Dec 2014 09:14:18 -0500 Subject: SL-92 WIP - track appearance message timing --- indra/newview/llvoavatar.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 118ed10eb2..765220cdd4 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -776,6 +776,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRuthTimer.reset(); mRuthDebugTimer.reset(); mDebugExistenceTimer.reset(); + mLastAppearanceMessageTimer.reset(); mPelvisOffset = LLVector3(0.0f,0.0f,0.0f); mLastPelvisToFoot = 0.0f; mPelvisFixup = 0.0f; @@ -3223,6 +3224,13 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { debug_line += llformat(" hov_z: %f", mHoverOffset[2]); } + F32 elapsed = mLastAppearanceMessageTimer.getElapsedTimeF32(); + static char *elapsed_chars = "Xx*..."; + U32 bucket = U32(elapsed*2); + if (bucket < strlen(elapsed_chars)) + { + debug_line += llformat(" %c", elapsed_chars[bucket]); + } addDebugText(debug_line); } if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) @@ -7147,6 +7155,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } + mLastAppearanceMessageTimer.reset(); + ESex old_sex = getSex(); LLAppearanceMessageContents contents; @@ -7331,6 +7341,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } + if (isSelf()) + { + LL_INFOS("Avatar") << "hover was set: " << contents.mHoverOffsetWasSet << " value_z " << contents.mHoverOffset[2] << LL_ENDL; + } + if (contents.mHoverOffsetWasSet && !isSelf()) { // Got an update for some other avatar. -- cgit v1.2.3 From 211c18d3b7de319570bb3be7f3607654d7ec98ac Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 16 Dec 2014 10:47:58 -0500 Subject: linux build fix --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 765220cdd4..25c7120a19 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3225,7 +3225,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) debug_line += llformat(" hov_z: %f", mHoverOffset[2]); } F32 elapsed = mLastAppearanceMessageTimer.getElapsedTimeF32(); - static char *elapsed_chars = "Xx*..."; + static const char *elapsed_chars = "Xx*..."; U32 bucket = U32(elapsed*2); if (bucket < strlen(elapsed_chars)) { -- cgit v1.2.3 From 553b7ede723ceed310f1dbbfba25f5bf555466e1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 22 Dec 2014 11:14:15 -0500 Subject: Moved AvatarPosFinalOffset to per-account settings file --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index da0e72a6ee..a6d006f13b 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7457,7 +7457,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) if (isSelf()) { - LL_INFOS("Avatar") << "hover was set: " << contents.mHoverOffsetWasSet << " value_z " << contents.mHoverOffset[2] << LL_ENDL; + LL_INFOS("Avatar") << avString() << "hover was set: " << contents.mHoverOffsetWasSet << " value_z " << contents.mHoverOffset[2] << LL_ENDL; } if (contents.mHoverOffsetWasSet && !isSelf()) @@ -7471,7 +7471,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { // If we don't get a value at all, we are presumably in a // region that does not support hover height. -// FIXME RESTORE AFTER TESTING + LL_WARNS() << "zeroing hover because not defined in appearance message" << LL_ENDL; mHoverOffset = LLVector3(0.0, 0.0, 0.0); } -- cgit v1.2.3 From 57363fdfd6921394be42000869e2d711e7212ea4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Jan 2015 14:13:19 -0500 Subject: SL-92 WIP - More consistent enforcement of min/max hover values. Setting is stored as a per-account F32 value. --- indra/newview/llvoavatar.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a6d006f13b..fd741e7e5f 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -111,6 +111,9 @@ extern F32 ANIM_SPEED_MAX; extern F32 ANIM_SPEED_MIN; extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG; +const F32 MAX_HOVER_Z = 2.0; +const F32 MIN_HOVER_Z = -2.0; + // #define OUTPUT_BREAST_DATA using namespace LLAvatarAppearanceDefines; -- cgit v1.2.3 From 62ab044b1ac9f757be40f951436ff11419feffb4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Jan 2015 15:34:40 -0500 Subject: SL-92 WIP - changed setting name to AvatarHoverOffsetZ --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fd741e7e5f..6669a797ce 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7470,12 +7470,12 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mHoverOffset = contents.mHoverOffset; } - if (!contents.mHoverOffsetWasSet) + if (!contents.mHoverOffsetWasSet && !isSelf()) { // If we don't get a value at all, we are presumably in a // region that does not support hover height. - LL_WARNS() << "zeroing hover because not defined in appearance message" << LL_ENDL; + LL_WARNS() << avString() << "zeroing hover because not defined in appearance message" << LL_ENDL; mHoverOffset = LLVector3(0.0, 0.0, 0.0); } -- cgit v1.2.3 From 07812106ed54d834a2cf0be28f312bbf0ad34a1d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Jan 2015 18:13:33 -0500 Subject: Moved mHoverOffset to LLCharacter so it's accessible inside animations. Apply offset when constrained to ground. --- indra/newview/llvoavatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6669a797ce..cbfda020b4 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -721,11 +721,11 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), mLastUpdateRequestCOFVersion(-1), - mLastUpdateReceivedCOFVersion(-1), - mHoverOffset(0.0, 0.0, 0.0) + mLastUpdateReceivedCOFVersion(-1) + //mHoverOffset(0.0, 0.0, 0.0) { //VTResume(); // VTune - + mHoverOffset = LLVector3(0.0, 0.0, 0.0); // mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); -- cgit v1.2.3 From ee63c30ea748857f68ac352a9751816644322ec3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 8 Jan 2015 10:35:36 -0500 Subject: SL-92 WIP - remove hover for self if we receive an appearance with no hover specified --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index aa7b848d0e..059a03a072 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7470,7 +7470,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mHoverOffset = contents.mHoverOffset; } - if (!contents.mHoverOffsetWasSet && !isSelf()) + if (!contents.mHoverOffsetWasSet) { // If we don't get a value at all, we are presumably in a // region that does not support hover height. -- cgit v1.2.3 From d5ab47b1bc9eac98c1f443fa965a91a8f2cf0af7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 13 Jan 2015 17:18:15 -0500 Subject: SL-92 WIP - added signal for simulator features received. Use to keep hover floater UI synced with region support for hover. --- indra/newview/llvoavatar.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 059a03a072..10bc6ad336 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3220,6 +3220,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) debug_line += llformat(" - cof rcv:%d", last_received_cof_version); } debug_line += llformat(" bsz-z: %f avofs-z: %f", mBodySize[2], mAvatarOffset[2]); + bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled(); + debug_line += hover_enabled ? " H" : " h"; if (mHoverOffset[2] != 0.0) { debug_line += llformat(" hov_z: %f", mHoverOffset[2]); -- cgit v1.2.3 From be83e48fc12fbaf225f9f3e6ad5042320595ce26 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 Jan 2015 17:40:44 -0500 Subject: SL-92 WIP - more on region notification and managing hover --- indra/newview/llvoavatar.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 10bc6ad336..b5bf174045 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -722,7 +722,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mUseLocalAppearance(FALSE), mLastUpdateRequestCOFVersion(-1), mLastUpdateReceivedCOFVersion(-1) - //mHoverOffset(0.0, 0.0, 0.0) { //VTResume(); // VTune mHoverOffset = LLVector3(0.0, 0.0, 0.0); @@ -7460,19 +7459,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } - if (isSelf()) - { - LL_INFOS("Avatar") << avString() << "hover was set: " << contents.mHoverOffsetWasSet << " value_z " << contents.mHoverOffset[2] << LL_ENDL; - } - if (contents.mHoverOffsetWasSet && !isSelf()) { - // Got an update for some other avatar. - // (Ignore updates for self because they may be out of date.) + // Got an update for some other avatar + // Ignore updates for self, because we have a more authoritative value in the preferences. mHoverOffset = contents.mHoverOffset; + LL_INFOS("Avatar") << avString() << "setting hover from message" << mHoverOffset[2] << LL_ENDL; } - if (!contents.mHoverOffsetWasSet) + if (!contents.mHoverOffsetWasSet && !isSelf()) { // If we don't get a value at all, we are presumably in a // region that does not support hover height. -- cgit v1.2.3 From d2de97ad8e84eedd42f4a0fe5b258617a96f154b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 15 Jan 2015 16:45:24 -0500 Subject: SL-92 WIP - more on hover management --- indra/newview/llvoavatar.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b5bf174045..38420a31bc 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -724,7 +724,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastUpdateReceivedCOFVersion(-1) { //VTResume(); // VTune - mHoverOffset = LLVector3(0.0, 0.0, 0.0); + setHoverOffset(LLVector3(0.0, 0.0, 0.0)); + // mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); @@ -3221,9 +3222,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) debug_line += llformat(" bsz-z: %f avofs-z: %f", mBodySize[2], mAvatarOffset[2]); bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled(); debug_line += hover_enabled ? " H" : " h"; - if (mHoverOffset[2] != 0.0) + const LLVector3& hover_offset = getHoverOffset(); + if (hover_offset[2] != 0.0) { - debug_line += llformat(" hov_z: %f", mHoverOffset[2]); + debug_line += llformat(" hov_z: %f", hover_offset[2]); } F32 elapsed = mLastAppearanceMessageTimer.getElapsedTimeF32(); static const char *elapsed_chars = "Xx*..."; @@ -3432,7 +3434,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; - root_pos += LLVector3d(mHoverOffset); + root_pos += LLVector3d(getHoverOffset()); LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); @@ -3602,7 +3604,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) else if (mDrawable.notNull()) { LLVector3 pos = mDrawable->getPosition(); - pos += mHoverOffset * mDrawable->getRotation(); + pos += getHoverOffset() * mDrawable->getRotation(); mRoot->setPosition(pos); mRoot->setRotation(mDrawable->getRotation()); } @@ -7463,8 +7465,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { // Got an update for some other avatar // Ignore updates for self, because we have a more authoritative value in the preferences. - mHoverOffset = contents.mHoverOffset; - LL_INFOS("Avatar") << avString() << "setting hover from message" << mHoverOffset[2] << LL_ENDL; + setHoverOffset(contents.mHoverOffset); + LL_INFOS("Avatar") << avString() << "setting hover from message" << contents.mHoverOffset[2] << LL_ENDL; } if (!contents.mHoverOffsetWasSet && !isSelf()) @@ -7472,7 +7474,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // If we don't get a value at all, we are presumably in a // region that does not support hover height. LL_WARNS() << avString() << "zeroing hover because not defined in appearance message" << LL_ENDL; - mHoverOffset = LLVector3(0.0, 0.0, 0.0); + setHoverOffset(LLVector3(0.0, 0.0, 0.0)); } setCompositeUpdatesEnabled( TRUE ); -- cgit v1.2.3 From 1c496b21b286f131652150eed4d13870127bd001 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 4 Mar 2015 14:29:41 -0500 Subject: MAINT-4858 FIX --- indra/newview/llvoavatar.cpp | 73 +++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 21 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3f75131780..a90fade3c9 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3178,12 +3178,8 @@ void LLVOAvatar::forceUpdateVisualMuteSettings() } -//------------------------------------------------------------------------ -// updateCharacter() -// called on both your avatar and other avatars -//------------------------------------------------------------------------ -BOOL LLVOAvatar::updateCharacter(LLAgent &agent) -{ +void LLVOAvatar::updateDebugText() +{ // clear debug text mDebugText.clear(); @@ -3226,6 +3222,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (hover_offset[2] != 0.0) { debug_line += llformat(" hov_z: %f", hover_offset[2]); + debug_line += llformat(" %s", (mIsSitting ? "S" : "T")); + debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); } F32 elapsed = mLastAppearanceMessageTimer.getElapsedTimeF32(); static const char *elapsed_chars = "Xx*..."; @@ -3241,7 +3239,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (!mBakedTextureDebugText.empty()) addDebugText(mBakedTextureDebugText); } - + if (LLVOAvatar::sShowAnimationDebug) { for (LLMotionController::motion_list_t::iterator iter = mMotionController.getActiveMotions().begin(); @@ -3270,6 +3268,27 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } } + if (!mDebugText.size() && mText.notNull()) + { + mText->markDead(); + mText = NULL; + } + else if (mDebugText.size()) + { + setDebugText(mDebugText); + } + mDebugText.clear(); + +} + +//------------------------------------------------------------------------ +// updateCharacter() +// called on both your avatar and other avatars +//------------------------------------------------------------------------ +BOOL LLVOAvatar::updateCharacter(LLAgent &agent) +{ + updateDebugText(); + if (!mIsBuilt) { return FALSE; @@ -3378,9 +3397,15 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) LLVector3 xyVel = getVelocity(); xyVel.mV[VZ] = 0.0f; speed = xyVel.length(); - + // remembering the value here prevents a display glitch if the + // animation gets toggled during this update. + bool was_sit_ground_constrained = isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED); + if (!(mIsSitting && getParent())) { + // This case includes all configurations except sitting on an + // object, so does include ground sit. + //-------------------------------------------------------------------- // get timing info // handle initial condition case @@ -3434,7 +3459,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; - root_pos += LLVector3d(getHoverOffset()); + if (!mIsSitting && !was_sit_ground_constrained) + { + root_pos += LLVector3d(getHoverOffset()); + } LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); @@ -3624,7 +3652,21 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { updateMotions(LLCharacter::NORMAL_UPDATE); } - + + // Special handling for sitting on ground. + if (!getParent() && (mIsSitting || was_sit_ground_constrained)) + { + + F32 off_z = LLVector3d(getHoverOffset()).mdV[VZ]; + if (off_z != 0.0) + { + LLVector3 pos = mRoot->getWorldPosition(); + pos.mV[VZ] += off_z; + mRoot->touch(); + mRoot->setWorldPosition(pos); + } + } + // update head position updateHeadOffset(); @@ -3708,17 +3750,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) mRoot->updateWorldMatrixChildren(); - if (!mDebugText.size() && mText.notNull()) - { - mText->markDead(); - mText = NULL; - } - else if (mDebugText.size()) - { - setDebugText(mDebugText); - } - mDebugText.clear(); - //mesh vertices need to be reskinned mNeedsSkin = TRUE; return TRUE; -- cgit v1.2.3