summaryrefslogtreecommitdiff
path: root/indra/llcharacter/lljoint.cpp
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2014-06-17 13:09:15 -0700
committerdolphin <dolphin@lindenlab.com>2014-06-17 13:09:15 -0700
commit299921de323eb9b6844cd7b6f6b8da3490ee3747 (patch)
treedcb4c5c257622c20014a0b986dc8e2d1c25a10c7 /indra/llcharacter/lljoint.cpp
parent89ea1cbc7acee8878c36a5795dd3df12a913c513 (diff)
parent977476171ddcc057d7c28b6c14ae988b8189ed75 (diff)
Merge with 3.7.9-release
Diffstat (limited to 'indra/llcharacter/lljoint.cpp')
-rwxr-xr-xindra/llcharacter/lljoint.cpp42
1 files changed, 18 insertions, 24 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index 1492cc172c..dbd6d48a95 100755
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -48,8 +48,11 @@ void LLJoint::init()
mParent = NULL;
mXform.setScaleChildOffset(TRUE);
mXform.setScale(LLVector3(1.0f, 1.0f, 1.0f));
+ mOldXform.setScaleChildOffset(TRUE);
+ mOldXform.setScale(LLVector3(1.0f, 1.0f, 1.0f));
mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY;
mUpdateXform = TRUE;
+ mResetAfterRestoreOldXform = false;
}
LLJoint::LLJoint() :
@@ -57,7 +60,6 @@ LLJoint::LLJoint() :
{
init();
touch();
- mResetAfterRestoreOldXform = false;
}
LLJoint::LLJoint(S32 joint_num) :
@@ -65,7 +67,6 @@ LLJoint::LLJoint(S32 joint_num) :
{
init();
touch();
- mResetAfterRestoreOldXform = false;
}
@@ -78,7 +79,6 @@ LLJoint::LLJoint(const std::string &name, LLJoint *parent) :
{
init();
mUpdateXform = FALSE;
- // *TODO: mResetAfterRestoreOldXform is not initialized!!!
setName(name);
if (parent)
@@ -239,11 +239,8 @@ const LLVector3& LLJoint::getPosition()
//--------------------------------------------------------------------
void LLJoint::setPosition( const LLVector3& pos )
{
-// if (mXform.getPosition() != pos)
- {
- mXform.setPosition(pos);
- touch(MATRIX_DIRTY | POSITION_DIRTY);
- }
+ mXform.setPosition(pos);
+ touch(MATRIX_DIRTY | POSITION_DIRTY);
}
@@ -251,38 +248,37 @@ void LLJoint::setPosition( const LLVector3& pos )
// setPosition()
//--------------------------------------------------------------------
void LLJoint::setDefaultFromCurrentXform( void )
-{
+{
mDefaultXform = mXform;
- touch(MATRIX_DIRTY | POSITION_DIRTY);
-
}
//--------------------------------------------------------------------
// storeCurrentXform()
//--------------------------------------------------------------------
void LLJoint::storeCurrentXform( const LLVector3& pos )
-{
+{
mOldXform = mXform;
- mResetAfterRestoreOldXform = true;
+ mResetAfterRestoreOldXform = true;
setPosition( pos );
+ touch(ALL_DIRTY);
}
+
//--------------------------------------------------------------------
-// restoreOldXform()
+// storeScaleForReset()
//--------------------------------------------------------------------
-void LLJoint::restoreOldXform( void )
+void LLJoint::storeScaleForReset( const LLVector3& scale )
{
- mResetAfterRestoreOldXform = false;
- mXform = mOldXform;
+ mOldXform.setScale( scale );
}
//--------------------------------------------------------------------
// restoreOldXform()
//--------------------------------------------------------------------
-void LLJoint::restoreToDefaultXform( void )
+void LLJoint::restoreOldXform( void )
{
mXform = mDefaultXform;
- setPosition( mXform.getPosition() );
+ mResetAfterRestoreOldXform = false;
+ mDirtyFlags = ALL_DIRTY;
}
-
//--------------------------------------------------------------------
// getWorldPosition()
//--------------------------------------------------------------------
@@ -299,8 +295,6 @@ LLVector3 LLJoint::getLastWorldPosition()
{
return mXform.getWorldPosition();
}
-
-
//--------------------------------------------------------------------
// setWorldPosition()
//--------------------------------------------------------------------
@@ -404,7 +398,7 @@ void LLJoint::setWorldRotation( const LLQuaternion& rot )
//--------------------------------------------------------------------
const LLVector3& LLJoint::getScale()
{
- return mXform.getScale();
+ return mXform.getScale();
}
//--------------------------------------------------------------------
@@ -413,7 +407,7 @@ const LLVector3& LLJoint::getScale()
void LLJoint::setScale( const LLVector3& scale )
{
// if (mXform.getScale() != scale)
- {
+ {
mXform.setScale(scale);
touch();
}