SL-109 WIP - minor code cleanup

master
Brad Payne (Vir Linden) 2016-02-26 16:54:00 -05:00
parent 2a4ed560c4
commit 80b010b199
4 changed files with 38 additions and 31 deletions

View File

@ -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()
//-----------------------------------------------------------------------------

View File

@ -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;

View File

@ -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);
}
}
}

View File

@ -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();