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 /indra/newview/llcontrolavatar.cpp | |
parent | b920893fa4be1b5e61e938bda79147a9c5522726 (diff) |
SL-9857 - suppress constraint adjustments immediately after region crossing
Diffstat (limited to 'indra/newview/llcontrolavatar.cpp')
-rw-r--r-- | indra/newview/llcontrolavatar.cpp | 29 |
1 files changed, 27 insertions, 2 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; + } +} |