summaryrefslogtreecommitdiff
path: root/indra/llcharacter/lltargetingmotion.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-12-07 20:27:13 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-12-07 20:27:13 +0000
commitb01d567a5d9e2b5dd28bcc7b3f474fabd93e7a2f (patch)
treec45377783f53f033d43a4d06d36bbeb2a7f7e79b /indra/llcharacter/lltargetingmotion.cpp
parenta64f283477ea4db09c8b515ab94709e1fb5c82af (diff)
EFFECTIVE MERGE: merge release@73232 maint-viewer-2@75100 -> maint-viewer-2-merge
EFFECTIVE MERGE: merge -r 74370 library-update -> maint-viewer-2-merge ACTUAL MERGE: release@75267 maint-viewer-2-merge@75293 -> release
Diffstat (limited to 'indra/llcharacter/lltargetingmotion.cpp')
-rw-r--r--indra/llcharacter/lltargetingmotion.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp
index d5fe65461b..c0ce11cb85 100644
--- a/indra/llcharacter/lltargetingmotion.cpp
+++ b/indra/llcharacter/lltargetingmotion.cpp
@@ -55,6 +55,8 @@ LLTargetingMotion::LLTargetingMotion(const LLUUID &id) : LLMotion(id)
{
mCharacter = NULL;
mName = "targeting";
+
+ mTorsoState = new LLJointState;
}
@@ -87,11 +89,11 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac
return STATUS_FAILURE;
}
- mTorsoState.setJoint( mTorsoJoint );
+ mTorsoState->setJoint( mTorsoJoint );
// add joint states to the pose
- mTorsoState.setUsage(LLJointState::ROT);
- addJointState( &mTorsoState );
+ mTorsoState->setUsage(LLJointState::ROT);
+ addJointState( mTorsoState );
return STATUS_SUCCESS;
}
@@ -127,7 +129,7 @@ BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
}
//LLVector3 target_plane_normal = LLVector3(1.f, 0.f, 0.f) * mPelvisJoint->getWorldRotation();
- //LLVector3 torso_dir = LLVector3(1.f, 0.f, 0.f) * (mTorsoJoint->getWorldRotation() * mTorsoState.getRotation());
+ //LLVector3 torso_dir = LLVector3(1.f, 0.f, 0.f) * (mTorsoJoint->getWorldRotation() * mTorsoState->getRotation());
LLVector3 skyward(0.f, 0.f, 1.f);
LLVector3 left(skyward % target);
@@ -151,14 +153,14 @@ BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
new_torso_rot = new_torso_rot * ~cur_torso_rot;
// slerp from current additive rotation to ideal additive rotation
- new_torso_rot = nlerp(slerp_amt, mTorsoState.getRotation(), new_torso_rot);
+ new_torso_rot = nlerp(slerp_amt, mTorsoState->getRotation(), new_torso_rot);
// constraint overall torso rotation
LLQuaternion total_rot = new_torso_rot * mTorsoJoint->getRotation();
total_rot.constrain(F_PI_BY_TWO * 0.8f);
new_torso_rot = total_rot * ~mTorsoJoint->getRotation();
- mTorsoState.setRotation(new_torso_rot);
+ mTorsoState->setRotation(new_torso_rot);
return result;
}