summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-07-17 16:52:19 +0000
committerDon Kjer <don@lindenlab.com>2012-07-17 16:52:19 +0000
commitcff3469d46d297fbec34bc0d648588e900cd255c (patch)
treed768ddbc8712c9e81387ae4b03dd8227229a0fe1 /indra/newview/llvoavatar.cpp
parent5a473a42a63d3277c65bb3bc96e49f020508cfe8 (diff)
parent509408f393b8eb58799678adde801675a4d4d600 (diff)
Merge viewer-development -> viewer-horde-fixes
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llvoavatar.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 1b7009a5c2..05febdf93b 100755..100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -817,6 +817,7 @@ LLVOAvatar::~LLVOAvatar()
lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl;
mRoot.removeAllChildren();
+ mJointMap.clear();
deleteAndClearArray(mSkeleton);
deleteAndClearArray(mCollisionVolumes);
@@ -1459,8 +1460,6 @@ void LLVOAvatar::onShift(const LLVector4a& shift_vector)
const LLVector3& shift = reinterpret_cast<const LLVector3&>(shift_vector);
mLastAnimExtents[0] += shift;
mLastAnimExtents[1] += shift;
- mNeedsImpostorUpdate = TRUE;
- mNeedsAnimUpdate = TRUE;
}
void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
@@ -1934,6 +1933,7 @@ void LLVOAvatar::buildCharacter()
// remove all of mRoot's children
//-------------------------------------------------------------------------
mRoot.removeAllChildren();
+ mJointMap.clear();
mIsBuilt = FALSE;
//-------------------------------------------------------------------------
@@ -2390,7 +2390,7 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid)
}
}
-static LLFastTimer::DeclareTimer FTM_AVATAR_UPDATE("Update Avatar");
+static LLFastTimer::DeclareTimer FTM_AVATAR_UPDATE("Avatar Update");
static LLFastTimer::DeclareTimer FTM_JOINT_UPDATE("Update Joints");
//------------------------------------------------------------------------
@@ -5137,7 +5137,20 @@ const LLUUID& LLVOAvatar::getID() const
// RN: avatar joints are multi-rooted to include screen-based attachments
LLJoint *LLVOAvatar::getJoint( const std::string &name )
{
- LLJoint* jointp = mRoot.findJoint(name);
+ joint_map_t::iterator iter = mJointMap.find(name);
+
+ LLJoint* jointp = NULL;
+
+ if (iter == mJointMap.end() || iter->second == NULL)
+ { //search for joint and cache found joint in lookup table
+ jointp = mRoot.findJoint(name);
+ mJointMap[name] = jointp;
+ }
+ else
+ { //return cached pointer
+ jointp = iter->second;
+ }
+
return jointp;
}