diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-10-12 18:53:49 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-10-12 18:53:49 +0100 |
commit | 0109a71d1ccf5f9bff9b454415ed67dd43b70157 (patch) | |
tree | 526045718d684507608fddd263081964984340ed | |
parent | b920893fa4be1b5e61e938bda79147a9c5522726 (diff) |
SL-9857 - suppress constraint adjustments immediately after region crossing
-rw-r--r-- | indra/newview/llcontrolavatar.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llcontrolavatar.h | 5 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 2 |
4 files changed, 35 insertions, 3 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 1eeeaa42ea..d3fd5813a0 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -40,13 +40,17 @@ const F32 LLControlAvatar::MAX_LEGAL_OFFSET = 3.0f; const F32 LLControlAvatar::MAX_LEGAL_SIZE = 64.0f; +//static +boost::signals2::connection LLControlAvatar::sRegionChangedSlot; + LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : LLVOAvatar(id, pcode, regionp), mPlaying(false), mGlobalScale(1.0f), mMarkedForDeath(false), mRootVolp(NULL), - mScaleConstraintFixup(1.0) + mScaleConstraintFixup(1.0), + mRegionChanged(false) { mIsDummy = TRUE; mIsControlAvatar = true; @@ -146,7 +150,16 @@ void LLControlAvatar::matchVolumeTransform() { LLVector3 new_pos_fixup; F32 new_scale_fixup; - getNewConstraintFixups(new_pos_fixup, new_scale_fixup); + if (mRegionChanged) + { + new_scale_fixup = mScaleConstraintFixup; + new_pos_fixup = mPositionConstraintFixup; + mRegionChanged = false; + } + else + { + getNewConstraintFixups(new_pos_fixup, new_scale_fixup); + } mPositionConstraintFixup = new_pos_fixup; mScaleConstraintFixup = new_scale_fixup; @@ -615,3 +628,15 @@ BOOL LLControlAvatar::isImpostor() } return LLVOAvatar::isImpostor(); } + +//static +void LLControlAvatar::onRegionChanged() +{ + std::vector<LLCharacter*>::iterator it = LLCharacter::sInstances.begin(); + for ( ; it != LLCharacter::sInstances.end(); ++it) + { + LLControlAvatar* cav = dynamic_cast<LLControlAvatar*>(*it); + if (!cav) continue; + cav->mRegionChanged = true; + } +} diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h index 70f6b76a21..288d07cd48 100644 --- a/indra/newview/llcontrolavatar.h +++ b/indra/newview/llcontrolavatar.h @@ -90,7 +90,10 @@ public: static const F32 MAX_LEGAL_OFFSET; static const F32 MAX_LEGAL_SIZE; - + + static void onRegionChanged(); + bool mRegionChanged; + static boost::signals2::connection sRegionChangedSlot; }; typedef std::map<LLUUID, S32> signaled_animation_map_t; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7b0029892c..0180ab8fb6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1110,6 +1110,8 @@ void LLVOAvatar::initClass() // Where should this be set initially? LLJoint::setDebugJointNames(gSavedSettings.getString("DebugAvatarJoints")); + + LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4d2b40347d..8c1242421e 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -530,6 +530,8 @@ public: BOOL mNeedsImpostorUpdate; F32SecondsImplicit mLastImpostorUpdateFrameTime; const LLVector3* getLastAnimExtents() const { return mLastAnimExtents; } + void setNeedsExtentUpdate(bool val) { mNeedsExtentUpdate = val; } + private: LLVector3 mImpostorOffset; LLVector2 mImpostorDim; |