Skip to content
Snippets Groups Projects
Commit 5dcd81c1 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

SL-451 - avoid more high-cost string operations in a per-frame function

parent dd2caad4
No related branches found
No related tags found
No related merge requests found
...@@ -1387,13 +1387,15 @@ bool LLModel::loadDecomposition(LLSD& header, std::istream& is) ...@@ -1387,13 +1387,15 @@ bool LLModel::loadDecomposition(LLSD& header, std::istream& is)
LLMeshSkinInfo::LLMeshSkinInfo(): LLMeshSkinInfo::LLMeshSkinInfo():
mPelvisOffset(0.0), mPelvisOffset(0.0),
mLockScaleIfJointPosition(false) mLockScaleIfJointPosition(false),
mInvalidJointsScrubbed(false)
{ {
} }
LLMeshSkinInfo::LLMeshSkinInfo(LLSD& skin): LLMeshSkinInfo::LLMeshSkinInfo(LLSD& skin):
mPelvisOffset(0.0), mPelvisOffset(0.0),
mLockScaleIfJointPosition(false) mLockScaleIfJointPosition(false),
mInvalidJointsScrubbed(false)
{ {
fromLLSD(skin); fromLLSD(skin);
} }
......
...@@ -56,6 +56,7 @@ class LLMeshSkinInfo ...@@ -56,6 +56,7 @@ class LLMeshSkinInfo
LLMatrix4 mBindShapeMatrix; LLMatrix4 mBindShapeMatrix;
float mPelvisOffset; float mPelvisOffset;
bool mLockScaleIfJointPosition; bool mLockScaleIfJointPosition;
bool mInvalidJointsScrubbed;
}; };
class LLModel : public LLVolume class LLModel : public LLVolume
......
...@@ -53,6 +53,10 @@ U32 LLSkinningUtil::getMeshJointCount(const LLMeshSkinInfo *skin) ...@@ -53,6 +53,10 @@ U32 LLSkinningUtil::getMeshJointCount(const LLMeshSkinInfo *skin)
// static // static
void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin) void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin)
{ {
if (skin->mInvalidJointsScrubbed)
{
return;
}
for (U32 j = 0; j < skin->mJointNames.size(); ++j) for (U32 j = 0; j < skin->mJointNames.size(); ++j)
{ {
// Fix invalid names to "mPelvis". Currently meshes with // Fix invalid names to "mPelvis". Currently meshes with
...@@ -63,6 +67,7 @@ void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin ...@@ -63,6 +67,7 @@ void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin
skin->mJointNames[j] = "mPelvis"; skin->mJointNames[j] = "mPelvis";
} }
} }
skin->mInvalidJointsScrubbed = true;
} }
// static // static
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment