SL-9857 - suppress constraint adjustments immediately after region crossing
parent
b920893fa4
commit
0109a71d1c
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1110,6 +1110,8 @@ void LLVOAvatar::initClass()
|
|||
|
||||
// Where should this be set initially?
|
||||
LLJoint::setDebugJointNames(gSavedSettings.getString("DebugAvatarJoints"));
|
||||
|
||||
LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue