diff options
-rwxr-xr-x | indra/llappearance/llavatarappearance.cpp | 11 | ||||
-rwxr-xr-x | indra/llcharacter/lljoint.h | 8 | ||||
-rwxr-xr-x | indra/llcharacter/llmotion.cpp | 11 | ||||
-rwxr-xr-x | indra/llcharacter/llmotioncontroller.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/character/avatar_lad.xml | 110 | ||||
-rwxr-xr-x | indra/newview/character/avatar_skeleton.xml | 24 |
6 files changed, 156 insertions, 9 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index d1eb389013..f73a46be8d 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -552,6 +552,12 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent { LLJoint* joint = NULL; + LL_DEBUGS("BVH") << "bone info: name " << info->mName + << " isJoint " << info->mIsJoint + << " volume_num " << volume_num + << " joint_num " << joint_num + << LL_ENDL; + if (info->mIsJoint) { joint = getCharacterJoint(joint_num); @@ -629,6 +635,7 @@ BOOL LLAvatarAppearance::allocateCharacterJoints( U32 num ) //----------------------------------------------------------------------------- BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) { + LL_DEBUGS("BVH") << "numBones " << info->mNumBones << " numCollisionVolumes " << info->mNumCollisionVolumes << LL_ENDL; //------------------------------------------------------------------------- // allocate joints //------------------------------------------------------------------------- @@ -655,8 +662,8 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) LLAvatarSkeletonInfo::bone_info_list_t::const_iterator iter; for (iter = info->mBoneInfoList.begin(); iter != info->mBoneInfoList.end(); ++iter) { - LLAvatarBoneInfo *info = *iter; - if (!setupBone(info, NULL, current_volume_num, current_joint_num)) + LLAvatarBoneInfo *bone_info = *iter; + if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num)) { LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL; return FALSE; diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 2abe1d6db1..523cb0b5e6 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -40,9 +40,11 @@ #include "xform.h" const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; -const U32 LL_CHARACTER_MAX_JOINTS = 32; // must be divisible by 4! -const U32 LL_HAND_JOINT_NUM = 31; -const U32 LL_FACE_JOINT_NUM = 30; +const U32 LL_CHARACTER_MAX_JOINTS = 48; // must be divisible by 4! +// FIXME BENTO - these should be higher than the joint_num of any +// other joint, to avoid conflicts in updateMotionsByType() +const U32 LL_HAND_JOINT_NUM = (LL_CHARACTER_MAX_JOINTS-1); +const U32 LL_FACE_JOINT_NUM = (LL_CHARACTER_MAX_JOINTS-2); const S32 LL_CHARACTER_MAX_PRIORITY = 7; const F32 LL_MAX_PELVIS_OFFSET = 5.f; 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 ) diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index c134b316fc..0ad34a0965 100755 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -585,6 +585,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty else { // NUM_JOINT_SIGNATURE_STRIDES should be multiple of 4 + // FIXME BENTO - think it's just the number of joints that needs to be a multiple of 4, not the number of strides. for (S32 i = 0; i < NUM_JOINT_SIGNATURE_STRIDES; i++) { U32 *current_signature = (U32*)&(mJointSignature[0][i * 4]); diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 9ec6428ee6..ac0b8b5704 100755 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -413,6 +413,116 @@ rotation="0 0 0" visible_in_first_person="true" /> + <attachment_point + id="41" + group="6" + pie_slice="2" + name="L Wing Shoulder" + joint="mLeftWingShoulder" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="42" + group="6" + pie_slice="2" + name="L Wing Elbow" + joint="mLeftWingElbow" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="43" + group="6" + pie_slice="2" + name="L Wing Wrist" + joint="mLeftWingWrist" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="44" + group="6" + pie_slice="2" + name="L Wing Tip" + joint="mLeftWingTip" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="45" + group="6" + pie_slice="2" + name="R Wing Shoulder" + joint="mRightWingShoulder" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="46" + group="6" + pie_slice="2" + name="R Wing Elbow" + joint="mRightWingElbow" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="47" + group="6" + pie_slice="2" + name="R Wing Wrist" + joint="mRightWingWrist" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="48" + group="6" + pie_slice="2" + name="R Wing Tip" + joint="mRightWingTip" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="49" + group="6" + pie_slice="2" + name="Tail 1" + joint="mTail_1" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="50" + group="6" + pie_slice="2" + name="Tail 2" + joint="mTail_2" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="51" + group="6" + pie_slice="2" + name="Tail 3" + joint="mTail_3" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + <param id="32" group="1" diff --git a/indra/newview/character/avatar_skeleton.xml b/indra/newview/character/avatar_skeleton.xml index 6b07bbc1d3..f81e58e807 100755 --- a/indra/newview/character/avatar_skeleton.xml +++ b/indra/newview/character/avatar_skeleton.xml @@ -1,6 +1,12 @@ <?xml version="1.0" encoding="US-ASCII" standalone="yes"?> <linden_skeleton version="1.0" num_bones="53" num_collision_volumes="26"> <bone name="mPelvis" pos="0.000 0.000 1.067" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 1.067015"> + <bone name="mTail_1" pos="-0.500 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.000000"> + <bone name="mTail_2" pos="-0.500 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.000000"> + <bone name="mTail_3" pos="-0.500 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.000000"> + </bone> + </bone> + </bone> <collision_volume name="PELVIS" pos = "-0.01 0 -0.02" rot="0.000000 8.00000 0.000000" scale="0.12 0.16 0.17"/> <collision_volume name="BUTT" pos = "-0.06 0 -0.1" rot="0.000000 0.00000 0.000000" scale="0.1 0.1 0.1"/> <bone name="mTorso" pos="0.000 0.000 0.084" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.084073"> @@ -27,6 +33,14 @@ </bone> <bone name="mCollarLeft" pos="-0.021 0.085 0.165" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.020927 0.084665 0.165396"> <collision_volume name="L_CLAVICLE" pos = "0.02 0 0.02" rot="0.000000 0.00000 0.000000" scale="0.07 0.14 0.05"/> + <bone name="mLeftWingShoulder" pos="0.000 0.079 -0.100" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + <bone name="mLeftWingElbow" pos="0.000 0.50 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + <bone name="mLeftWingWrist" pos="0.000 0.50 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + <bone name="mLeftWingTip" pos="0.000 0.50 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + </bone> + </bone> + </bone> + </bone> <bone name="mShoulderLeft" pos="0.000 0.079 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> <collision_volume name="L_UPPER_ARM" pos = "0.0 0.12 0.01" rot="-5.000000 0.00000 0.000000" scale="0.05 0.17 0.05"/> <bone name="mElbowLeft" pos="0.000 0.248 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.248000 0.000000"> @@ -39,6 +53,14 @@ </bone> <bone name="mCollarRight" pos="-0.021 -0.085 0.165" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.020927 -0.085000 0.165396"> <collision_volume name="R_CLAVICLE" pos = "0.02 0 0.02" rot="0.000000 0.00000 0.000000" scale="0.07 0.14 0.05"/> + <bone name="mRightWingShoulder" pos="0.000 -0.079 -0.100" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + <bone name="mRightWingElbow" pos="0.000 -0.50 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + <bone name="mRightWingWrist" pos="0.000 -0.50 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + <bone name="mRightWingTip" pos="0.000 -0.50 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000"> + </bone> + </bone> + </bone> + </bone> <bone name="mShoulderRight" pos="0.000 -0.079 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.079418 -0.000000"> <collision_volume name="R_UPPER_ARM" pos = "0.0 -0.12 0.01" rot="5.000000 0.00000 0.000000" scale="0.05 0.17 0.05"/> <bone name="mElbowRight" pos="0.000 -0.248 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.248000 -0.000000"> @@ -78,4 +100,4 @@ </bone> </bone> </bone> -</linden_skeleton>
\ No newline at end of file +</linden_skeleton> |