summaryrefslogtreecommitdiff
path: root/indra/newview/llcontrolavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llcontrolavatar.cpp')
-rw-r--r--indra/newview/llcontrolavatar.cpp29
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;
+ }
+}