diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp index 17aa55ca0a..7ca0928171 100644 --- a/indra/llappearance/llavatarjointmesh.cpp +++ b/indra/llappearance/llavatarjointmesh.cpp @@ -41,6 +41,41 @@ #include "llmatrix4a.h" +// Utility functions added with Bento to simplify handling of extra +// spine joints, or other new joints internal to the original +// skeleton, and unknown to the system avatar. + +//----------------------------------------------------------------------------- +// getBaseSkeletonAncestor() +//----------------------------------------------------------------------------- +LLAvatarJoint *getBaseSkeletonAncestor(LLAvatarJoint* joint) +{ + LLJoint *ancestor = joint->getParent(); + while (ancestor->getParent() && (ancestor->getSupport() != LLJoint::SUPPORT_BASE)) + { + LL_DEBUGS("Avatar") << "skipping non-base ancestor " << ancestor->getName() << LL_ENDL; + ancestor = ancestor->getParent(); + } + return (LLAvatarJoint*) ancestor; +} + +//----------------------------------------------------------------------------- +// totalSkinOffset() +//----------------------------------------------------------------------------- +LLVector3 totalSkinOffset(LLAvatarJoint *joint) +{ + LLVector3 totalOffset; + while (joint) + { + if (joint->getSupport() == LLJoint::SUPPORT_BASE) + { + totalOffset += joint->getSkinOffset(); + } + joint = (LLAvatarJoint*)joint->getParent(); + } + return totalOffset; +} + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // LLAvatarJointMesh::LLSkinJoint @@ -64,31 +99,6 @@ LLSkinJoint::~LLSkinJoint() } -LLAvatarJoint *getBaseSkeletonAncestor(LLAvatarJoint* joint) -{ - LLJoint *ancestor = joint->getParent(); - while (ancestor->getParent() && (ancestor->getSupport() != LLJoint::SUPPORT_BASE)) - { - LL_DEBUGS("Avatar") << "skipping non-base ancestor " << ancestor->getName() << LL_ENDL; - ancestor = ancestor->getParent(); - } - return (LLAvatarJoint*) ancestor; -} - -LLVector3 totalSkinOffset(LLAvatarJoint *joint) -{ - LLVector3 totalOffset; - while (joint) - { - if (joint->getSupport() == LLJoint::SUPPORT_BASE) - { - totalOffset += joint->getSkinOffset(); - } - joint = (LLAvatarJoint*)joint->getParent(); - } - return totalOffset; -} - //----------------------------------------------------------------------------- // LLSkinJoint::setupSkinJoint() //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 12c03e0894..d8185aa693 100755 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -37,6 +37,7 @@ #include "llanimationstates.h" #include "llstl.h" +// This is why LL_CHARACTER_MAX_ANIMATED_JOINTS needs to be a multiple of 4. const S32 NUM_JOINT_SIGNATURE_STRIDES = LL_CHARACTER_MAX_ANIMATED_JOINTS / 4; const U32 MAX_MOTION_INSTANCES = 32; diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 2632296c70..43a81ada49 100755 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -195,7 +195,6 @@ void LLViewerJointMesh::uploadJointMatrices() for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.size(); ++joint_num) { gJointMatAligned[joint_num].loadu(gJointMatUnaligned[joint_num]); - //gJointMatAligned[joint_num].loadu(*reference_mesh->mJointRenderData[joint_num]->mWorldMatrix); } } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 84d585df02..a8cc797f16 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1384,14 +1384,11 @@ void render_sphere_and_line(const LLVector3& begin_pos, const LLVector3& end_pos void LLVOAvatar::renderCollisionVolumes() { std::ostringstream ostr; - for (S32 i = 0; i < mNumCollisionVolumes; i++) - { - //mCollisionVolumes[i].renderCollision(); - ostr << mCollisionVolumes[i].getName() << ", "; - } for (S32 i = 0; i < mNumCollisionVolumes; i++) { + ostr << mCollisionVolumes[i].getName() << ", "; + LLAvatarJointCollisionVolume& collision_volume = mCollisionVolumes[i]; collision_volume.updateWorldMatrix();