summaryrefslogtreecommitdiff
path: root/indra/llcharacter/llmotion.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-05-28 17:28:49 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-05-28 17:28:49 -0400
commitb27492de06d0f5cbd45a892618ecb2d561a7181b (patch)
treeaab928296655683506d1f0a39a1fff3c7549db14 /indra/llcharacter/llmotion.cpp
parente8a196f5fff37a9f2aa2bd5b3a7500682aeb8ce7 (diff)
SL-117 WIP - initial placeholders for wing, tail joints. Updated max joints to 48 and added some debugging.
Diffstat (limited to 'indra/llcharacter/llmotion.cpp')
-rwxr-xr-xindra/llcharacter/llmotion.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp
index 4803f855de..2d646b4ed2 100755
--- a/indra/llcharacter/llmotion.cpp
+++ b/indra/llcharacter/llmotion.cpp
@@ -111,9 +111,14 @@ void LLMotion::addJointState(const LLPointer<LLJointState>& jointState)
U32 usage = jointState->getUsage();
// for now, usage is everything
- mJointSignature[0][jointState->getJoint()->getJointNum()] = (usage & LLJointState::POS) ? (0xff >> (7 - priority)) : 0;
- mJointSignature[1][jointState->getJoint()->getJointNum()] = (usage & LLJointState::ROT) ? (0xff >> (7 - priority)) : 0;
- mJointSignature[2][jointState->getJoint()->getJointNum()] = (usage & LLJointState::SCALE) ? (0xff >> (7 - priority)) : 0;
+ S32 joint_num = jointState->getJoint()->getJointNum();
+ if ((joint_num >= (S32)LL_CHARACTER_MAX_JOINTS) || (joint_num < 0))
+ {
+ LL_WARNS() << "joint_num " << joint_num << " is outside of legal range [0-" << LL_CHARACTER_MAX_JOINTS << ")" << LL_ENDL;
+ }
+ mJointSignature[0][joint_num] = (usage & LLJointState::POS) ? (0xff >> (7 - priority)) : 0;
+ mJointSignature[1][joint_num] = (usage & LLJointState::ROT) ? (0xff >> (7 - priority)) : 0;
+ mJointSignature[2][joint_num] = (usage & LLJointState::SCALE) ? (0xff >> (7 - priority)) : 0;
}
void LLMotion::setDeactivateCallback( void (*cb)(void *), void* userdata )