From 85a13b53f5570c44c476a7af70846874dfc3ecbf Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 12 Aug 2016 14:20:44 -0400 Subject: MAINT-6631 - reluctantly, added support for animation of collision volumes, to avoid breaking existing content. --- indra/llappearance/llavatarappearance.cpp | 6 ++++-- indra/llappearance/llavatarappearance.h | 2 ++ indra/llcharacter/lljoint.h | 7 ++++--- indra/newview/llvoavatar.cpp | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index acb43d23a1..f9745efb78 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -186,7 +186,8 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : mPelvisToFoot(0.f), mHeadOffset(), mRoot(NULL), - mWearableData(wearable_data) + mWearableData(wearable_data), + mNextJointNum(0) { llassert_always(mWearableData); mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES); @@ -625,6 +626,8 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent volume_num++; } + joint->setJointNum(mNextJointNum++); + // setup children LLAvatarBoneInfo::child_list_t::const_iterator iter; for (iter = info->mChildList.begin(); iter != info->mChildList.end(); ++iter) @@ -1276,7 +1279,6 @@ LLJoint *LLAvatarAppearance::getCharacterJoint( U32 num ) if (!mSkeleton[num]) { mSkeleton[num] = createAvatarJoint(); - mSkeleton[num]->setJointNum(num); } return mSkeleton[num]; } diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 3865da7098..dbcc1bfcf0 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -139,6 +139,8 @@ public: typedef std::map joint_map_t; joint_map_t mJointMap; + + S32 mNextJointNum; void computeBodySize(); diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 2afdef1026..b2736f6c1e 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -40,9 +40,10 @@ #include "xform.h" const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; -// Need to set this to count of animate-able joints (currently #bones + -// #attachments) + 2, rounded to next multiple of 4. -const U32 LL_CHARACTER_MAX_ANIMATED_JOINTS = 192; // must be divisible by 4! +// Need to set this to count of animate-able joints, +// currently = #bones + #collision_volumes + #attachments + 2, +// rounded to next multiple of 4. +const U32 LL_CHARACTER_MAX_ANIMATED_JOINTS = 216; // must be divisible by 4! const U32 LL_MAX_JOINTS_PER_MESH_OBJECT = 110; // These should be higher than the joint_num of any diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b1282fb4de..6e436e85e9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5921,7 +5921,7 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints) attachment->setVisibleInFirstPerson(info->mVisibleFirstPerson); attachment->setIsHUDAttachment(info->mIsHUDAttachment); // attachment can potentially be animated, needs a number. - attachment->setJointNum(mSkeleton.size() + attachmentID - 1); + attachment->setJointNum(mNextJointNum++); if (newly_created) { -- cgit v1.2.3