diff options
| author | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-09 15:21:20 +0200 |
|---|---|---|
| committer | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-09 15:21:20 +0200 |
| commit | 29105b117db2da4607200629ae6767b129a51d8c (patch) | |
| tree | 95a259dd91afa834d80bb30a14e696c3cbba07b5 /indra/llcharacter | |
| parent | b9bf48774899377ceee90d7e0538dc7dcbe86461 (diff) | |
| parent | 90d985946ce167a313e2765728caf2652931dfdd (diff) | |
Merge from default branch.
--HG--
branch : product-engine
Diffstat (limited to 'indra/llcharacter')
| -rw-r--r-- | indra/llcharacter/llheadrotmotion.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 88cd77f7af..0ee378f3b8 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -251,10 +251,13 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) mLastHeadRot = head_rot_local; // Set the head rotation. - LLQuaternion torsoRotLocal = mNeckState->getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld; - head_rot_local = head_rot_local * ~torsoRotLocal; - mNeckState->setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) ); - mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local)); + if(mNeckState->getJoint() && mNeckState->getJoint()->getParent()) + { + LLQuaternion torsoRotLocal = mNeckState->getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld; + head_rot_local = head_rot_local * ~torsoRotLocal; + mNeckState->setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) ); + mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local)); + } return TRUE; } |
