summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2008-02-27 18:58:14 +0000
committerBrad Kittenbrink <brad@lindenlab.com>2008-02-27 18:58:14 +0000
commit6d52efe452aa8469e0343da1c7d108f3f52ab651 (patch)
treea87be48e9840d7fc1f7ee514d7c7f994e71fdb3c /indra/llcharacter
parent6027ad2630b8650cabcf00628ee9b0d25bedd67f (diff)
Merge of windlight into release (QAR-286). This includes all changes in
windlight14 which have passed QA (up through r79932). svn merge -r 80831:80833 svn+ssh://svn.lindenlab.com/svn/linden/branches/merge_windlight14_r80620
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp58
-rw-r--r--indra/llcharacter/llkeyframemotion.h1
-rw-r--r--indra/llcharacter/llmotioncontroller.cpp9
-rw-r--r--indra/llcharacter/llmotioncontroller.h2
-rw-r--r--indra/llcharacter/llpose.cpp23
5 files changed, 24 insertions, 69 deletions
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 76fa0b93ee..1d00f18f2d 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -2030,64 +2030,6 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
}
}
-
-//-----------------------------------------------------------------------------
-// writeCAL3D()
-//-----------------------------------------------------------------------------
-void LLKeyframeMotion::writeCAL3D(apr_file_t* fp)
-{
-// <ANIMATION VERSION="1000" DURATION="1.03333" NUMTRACKS="58">
-// <TRACK BONEID="0" NUMKEYFRAMES="31">
-// <KEYFRAME TIME="0">
-// <TRANSLATION>0 0 48.8332</TRANSLATION>
-// <ROTATION>0.0512905 0.05657 0.66973 0.738668</ROTATION>
-// </KEYFRAME>
-// </TRACK>
-// </ANIMATION>
-
- apr_file_printf(fp, "<ANIMATION VERSION=\"1000\" DURATION=\"%.5f\" NUMTRACKS=\"%d\">\n", getDuration(), mJointMotionList->getNumJointMotions());
- for (U32 joint_index = 0; joint_index < mJointMotionList->getNumJointMotions(); joint_index++)
- {
- JointMotion* joint_motionp = mJointMotionList->getJointMotion(joint_index);
- LLJoint* animated_joint = mCharacter->getJoint(joint_motionp->mJointName);
- S32 joint_num = animated_joint->mJointNum + 1;
-
- apr_file_printf(fp, " <TRACK BONEID=\"%d\" NUMKEYFRAMES=\"%d\">\n", joint_num, joint_motionp->mRotationCurve.mNumKeys );
- PositionKey* pos_keyp = joint_motionp->mPositionCurve.mKeys.getFirstData();
- for (RotationKey* rot_keyp = joint_motionp->mRotationCurve.mKeys.getFirstData();
- rot_keyp;
- rot_keyp = joint_motionp->mRotationCurve.mKeys.getNextData())
- {
- apr_file_printf(fp, " <KEYFRAME TIME=\"%0.3f\">\n", rot_keyp->mTime);
- LLVector3 nominal_pos = animated_joint->getPosition();
- if (animated_joint->getParent())
- {
- nominal_pos.scaleVec(animated_joint->getParent()->getScale());
- }
- nominal_pos = nominal_pos * 100.f;
-
- if (joint_motionp->mUsage & LLJointState::POS && pos_keyp)
- {
- LLVector3 pos_val = pos_keyp->mPosition;
- pos_val = pos_val * 100.f;
- pos_val += nominal_pos;
- apr_file_printf(fp, " <TRANSLATION>%0.4f %0.4f %0.4f</TRANSLATION>\n", pos_val.mV[VX], pos_val.mV[VY], pos_val.mV[VZ]);
- pos_keyp = joint_motionp->mPositionCurve.mKeys.getNextData();
- }
- else
- {
- apr_file_printf(fp, " <TRANSLATION>%0.4f %0.4f %0.4f</TRANSLATION>\n", nominal_pos.mV[VX], nominal_pos.mV[VY], nominal_pos.mV[VZ]);
- }
-
- LLQuaternion rot_val = ~rot_keyp->mRotation;
- apr_file_printf(fp, " <ROTATION>%0.4f %0.4f %0.4f %0.4f</ROTATION>\n", rot_val.mQ[VX], rot_val.mQ[VY], rot_val.mQ[VZ], rot_val.mQ[VW]);
- apr_file_printf(fp, " </KEYFRAME>\n");
- }
- apr_file_printf(fp, " </TRACK>\n");
- }
- apr_file_printf(fp, "</ANIMATION>\n");
-}
-
//--------------------------------------------------------------------
// LLKeyframeDataCache::dumpDiagInfo()
//--------------------------------------------------------------------
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index 9cea7f3a59..8d6ebbf4b7 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -158,7 +158,6 @@ public:
U32 getFileSize();
BOOL serialize(LLDataPacker& dp) const;
BOOL deserialize(LLDataPacker& dp);
- void writeCAL3D(apr_file_t* fp);
BOOL isLoaded() { return mJointMotionList != NULL; }
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 603ee6a27b..fff19dbefe 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -746,7 +746,7 @@ void LLMotionController::updateMotion()
// is calculating a new keyframe pose, make sure the last one gets applied
mPoseBlender.interpolate(1.f);
- mPoseBlender.clearBlenders();
+ clearBlenders();
mTimeStepCount = quantum_count;
mLastTime = mTime;
@@ -824,6 +824,13 @@ void LLMotionController::updateMotion()
//-----------------------------------------------------------------------------
BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
{
+ // It's not clear why the getWeight() line seems to be crashing this, but
+ // hopefully this fixes it.
+ if (motion == NULL || motion->getPose() == NULL)
+ {
+ return FALSE;
+ }
+
if (mLoadingMotions.find(motion) != mLoadingMotions.end())
{
// we want to start this motion, but we can't yet, so flag it as started
diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h
index 63c9219fbf..effea0940a 100644
--- a/indra/llcharacter/llmotioncontroller.h
+++ b/indra/llcharacter/llmotioncontroller.h
@@ -157,6 +157,8 @@ public:
// deactivates terminated motions`
void updateMotion();
+ void clearBlenders() { mPoseBlender.clearBlenders(); }
+
// flush motions
// releases all motion instances
void flushAllMotions();
diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp
index 557bbd2d56..2120cb223e 100644
--- a/indra/llcharacter/llpose.cpp
+++ b/indra/llcharacter/llpose.cpp
@@ -379,15 +379,20 @@ void LLJointStateBlender::blendJointStates(BOOL apply_now)
}
}
- // apply blended transforms
- target_joint->setPosition(blended_pos);
- target_joint->setScale(blended_scale);
- target_joint->setRotation(blended_rot);
-
- // apply additive transforms
- target_joint->setPosition(target_joint->getPosition() + added_pos);
- target_joint->setScale(target_joint->getScale() + added_scale);
- target_joint->setRotation(added_rot * target_joint->getRotation());
+ if (!added_scale.isFinite())
+ {
+ added_scale.clearVec();
+ }
+
+ if (!blended_scale.isFinite())
+ {
+ blended_scale.setVec(1,1,1);
+ }
+
+ // apply transforms
+ target_joint->setPosition(blended_pos + added_pos);
+ target_joint->setScale(blended_scale + added_scale);
+ target_joint->setRotation(added_rot * blended_rot);
if (apply_now)
{