summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-10-06 12:54:21 -0500
committerDave Parks <davep@lindenlab.com>2010-10-06 12:54:21 -0500
commitadc73f48471330617cc1e52902abd8123920ada3 (patch)
tree553b190684dccd0707de2570e614ebd91a30d8db /indra/llcharacter
parent21b1b91c448b7d148a840c06d74deabc45af1819 (diff)
parent98d622551d9466d1153dedfbdd721becf8c38cd9 (diff)
Merge
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/lljoint.cpp19
-rw-r--r--indra/llcharacter/lljoint.h8
2 files changed, 26 insertions, 1 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index 2449b01e15..522d760c7d 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -239,6 +239,17 @@ void LLJoint::setPosition( const LLVector3& pos )
}
}
+
+//--------------------------------------------------------------------
+// setPosition()
+//--------------------------------------------------------------------
+void LLJoint::setDefaultFromCurrentXform( void )
+{
+ mDefaultXform = mXform;
+ touch(MATRIX_DIRTY | POSITION_DIRTY);
+
+}
+
//--------------------------------------------------------------------
// storeCurrentXform()
//--------------------------------------------------------------------
@@ -254,6 +265,14 @@ void LLJoint::restoreOldXform( void )
{
mXform = mOldXform;
}
+//--------------------------------------------------------------------
+// restoreOldXform()
+//--------------------------------------------------------------------
+void LLJoint::restoreToDefaultXform( void )
+{
+ mXform = mDefaultXform;
+ setPosition( mXform.getPosition() );
+}
//--------------------------------------------------------------------
// getWorldPosition()
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index cf644e899f..6506f8ad03 100644
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -87,6 +87,7 @@ protected:
// explicit transformation members
LLXformMatrix mXform;
LLXformMatrix mOldXform;
+ LLXformMatrix mDefaultXform;
public:
U32 mDirtyFlags;
@@ -137,7 +138,9 @@ public:
// get/set local position
const LLVector3& getPosition();
void setPosition( const LLVector3& pos );
-
+
+ void setDefaultPosition( const LLVector3& pos );
+
// get/set world position
LLVector3 getWorldPosition();
LLVector3 getLastWorldPosition();
@@ -181,6 +184,9 @@ public:
void setJointNum(S32 joint_num) { mJointNum = joint_num; }
void restoreOldXform( void );
+ void restoreToDefaultXform( void );
+ void setDefaultFromCurrentXform( void );
+
void storeCurrentXform( const LLVector3& pos );
};
#endif // LL_LLJOINT_H