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/llvoavatarself.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 42a7c2e576..f4c6472f7a 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -163,6 +163,8 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, { mMotionController.mIsSelf = TRUE; + mHoverOffset = gSavedSettings.getVector3("AvatarPosFinalOffset"); + LL_DEBUGS() << "Marking avatar as self " << id << LL_ENDL; } -- 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/llvoavatarself.cpp | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f4c6472f7a..a5379f24ba 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -127,6 +127,25 @@ struct LocalTextureData LLTextureEntry *mTexEntry; }; +// TODO - this class doesn't really do anything, could just use a base +// class responder if nothing else gets added. +class LLHoverHeightResponder: public LLHTTPClient::Responder +{ +public: + LLHoverHeightResponder(): LLHTTPClient::Responder() {} + +private: + void httpFailure() + { + LL_WARNS() << dumpResponse() << LL_ENDL; + } + + void httpSuccess() + { + LL_INFOS() << dumpResponse() << LL_ENDL; + } +}; + //----------------------------------------------------------------------------- // Callback data //----------------------------------------------------------------------------- @@ -163,8 +182,6 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, { mMotionController.mIsSelf = TRUE; - mHoverOffset = gSavedSettings.getVector3("AvatarPosFinalOffset"); - LL_DEBUGS() << "Marking avatar as self " << id << LL_ENDL; } @@ -222,6 +239,8 @@ void LLVOAvatarSelf::initInstance() return; } + mHoverOffset = gSavedSettings.getVector3("AvatarPosFinalOffset"); + //doPeriodically(output_self_av_texture_diagnostics, 30.0); doPeriodically(update_avatar_rez_metrics, 5.0); doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0); @@ -2687,6 +2706,22 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const return success; } +//------------------------------------------------------------------------ +// sendHoverHeight() +//------------------------------------------------------------------------ +void LLVOAvatarSelf::sendHoverHeight() const +{ + std::string url = gAgent.getRegion()->getCapability("AgentPreferences"); + + if (!url.empty()) + { + LLSD update = LLSD::emptyMap(); + update["hover_height"] = mHoverOffset[2]; + + LL_DEBUGS("Avatar") << "sending hover height value " << mHoverOffset[2] << LL_ENDL; + LLHTTPClient::post(url, update, new LLHoverHeightResponder); + } +} //------------------------------------------------------------------------ // needsRenderBeam() -- 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/llvoavatarself.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 3d82a6dab6..6e0c9cb68c 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,7 +239,8 @@ void LLVOAvatarSelf::initInstance() return; } - mHoverOffset = gSavedSettings.getVector3("AvatarPosFinalOffset"); + mHoverOffset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); + LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; //doPeriodically(output_self_av_texture_diagnostics, 30.0); doPeriodically(update_avatar_rez_metrics, 5.0); @@ -2734,7 +2735,7 @@ void LLVOAvatarSelf::sendHoverHeight() const LLSD update = LLSD::emptyMap(); update["hover_height"] = mHoverOffset[2]; - LL_DEBUGS("Avatar") << "sending hover height value " << mHoverOffset[2] << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "sending hover height value " << mHoverOffset[2] << LL_ENDL; LLHTTPClient::post(url, update, new LLHoverHeightResponder); } } -- 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/llvoavatarself.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6e0c9cb68c..1b5901e581 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,7 +239,8 @@ void LLVOAvatarSelf::initInstance() return; } - mHoverOffset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); + F32 hover_z = gSavedPerAccountSettings.getF32("AvatarPosFinalOffset"); + mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; //doPeriodically(output_self_av_texture_diagnostics, 30.0); -- 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/llvoavatarself.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 1b5901e581..ed560b1c30 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,7 +239,7 @@ void LLVOAvatarSelf::initInstance() return; } - F32 hover_z = gSavedPerAccountSettings.getF32("AvatarPosFinalOffset"); + F32 hover_z = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; -- 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/llvoavatarself.cpp | 48 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ed560b1c30..5341c6f1c8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,15 +239,40 @@ void LLVOAvatarSelf::initInstance() return; } - F32 hover_z = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); - mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); - LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; + setHoverIfRegionEnabled(); //doPeriodically(output_self_av_texture_diagnostics, 30.0); doPeriodically(update_avatar_rez_metrics, 5.0); doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0); } +void LLVOAvatarSelf::setHoverIfRegionEnabled() +{ + if (getRegion() && getRegion()->simulatorFeaturesReceived()) + { + if (getRegion()->avatarHoverHeightEnabled()) + { + F32 hover_z = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); + mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); + LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; + } + else + { + mHoverOffset = LLVector3(0.0, 0.0, 0.0); + LL_INFOS("Avatar") << avString() << " zeroing hover height, region does not support" << LL_ENDL; + } + } + else + { + LL_INFOS("Avatar") << avString() << " region or simulator features not known, no change on hover" << LL_ENDL; + if (getRegion()) + { + getRegion()->setSimulatorFeaturesReceivedCallback(boost::bind(&LLVOAvatarSelf::onSimulatorFeaturesReceived,this,_1)); + } + + } +} + bool LLVOAvatarSelf::checkStuckAppearance() { const F32 CONDITIONAL_UNSTICK_INTERVAL = 300.0; @@ -850,6 +875,12 @@ void LLVOAvatarSelf::removeMissingBakedTextures() } } +void LLVOAvatarSelf::onSimulatorFeaturesReceived(const LLUUID& region_id) +{ + LL_INFOS("Avatar") << "simulator features received, setting hover based on region props" << LL_ENDL; + setHoverIfRegionEnabled(); +} + //virtual void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) { @@ -868,6 +899,17 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) //LL_INFOS() << "pos_from_old_region is " << global_pos_from_old_region // << " while pos_from_new_region is " << pos_from_new_region // << LL_ENDL; + + // Update hover height, or schedule callback, based on whether + // it's supported in this region. + if (regionp->simulatorFeaturesReceived()) + { + setHoverIfRegionEnabled(); + } + else + { + regionp->setSimulatorFeaturesReceivedCallback(boost::bind(&LLVOAvatarSelf::onSimulatorFeaturesReceived,this,_1)); + } } if (!regionp || (regionp->getHandle() != mLastRegionHandle)) -- 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/llvoavatarself.cpp | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 5341c6f1c8..bd7ab41258 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -178,7 +178,10 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, mScreenp(NULL), mLastRegionHandle(0), mRegionCrossingCount(0), - mInitialBakesLoaded(false) + mInitialBakesLoaded(false), + // Value outside legal range, so will always be a mismatch the + // first time through. + mLastHoverOffsetSent(LLVector3(0.0f, 0.0f, -999.0f)) { mMotionController.mIsSelf = TRUE; @@ -253,12 +256,12 @@ void LLVOAvatarSelf::setHoverIfRegionEnabled() if (getRegion()->avatarHoverHeightEnabled()) { F32 hover_z = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); - mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); - LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; + setHoverOffset(LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z))); + LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << hover_z << LL_ENDL; } else { - mHoverOffset = LLVector3(0.0, 0.0, 0.0); + setHoverOffset(LLVector3(0.0, 0.0, 0.0)); LL_INFOS("Avatar") << avString() << " zeroing hover height, region does not support" << LL_ENDL; } } @@ -2776,10 +2779,27 @@ void LLVOAvatarSelf::sendHoverHeight() const if (!url.empty()) { LLSD update = LLSD::emptyMap(); - update["hover_height"] = mHoverOffset[2]; + const LLVector3& hover_offset = getHoverOffset(); + update["hover_height"] = hover_offset[2]; - LL_DEBUGS("Avatar") << avString() << "sending hover height value " << mHoverOffset[2] << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "sending hover height value " << hover_offset[2] << LL_ENDL; LLHTTPClient::post(url, update, new LLHoverHeightResponder); + + mLastHoverOffsetSent = hover_offset; + } +} + +void LLVOAvatarSelf::setHoverOffset(const LLVector3& hover_offset, bool send_update) +{ + if (getHoverOffset() != hover_offset) + { + LL_INFOS("Avatar") << avString() << " setting hover due to change " << hover_offset[2] << LL_ENDL; + LLVOAvatar::setHoverOffset(hover_offset, send_update); + } + if (send_update && (hover_offset != mLastHoverOffsetSent)) + { + LL_INFOS("Avatar") << avString() << " sending hover due to change " << hover_offset[2] << LL_ENDL; + sendHoverHeight(); } } -- cgit v1.2.3