Lazy workaround avoiding undefined behavior for rigged meshes with invalid joints.

This commit is contained in:
Shyotl
2014-02-10 20:20:03 -06:00
parent f7fdeeea9b
commit dda7cb5791

View File

@@ -1575,6 +1575,10 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
for (U32 j = 0; j < count; ++j)
{
LLJoint* joint = avatar->getJoint(skin->mJointNames[j]);
if(!joint)
{
joint = avatar->getJoint("mRoot");
}
if (joint)
{
mat[j] = skin->mInvBindMatrix[j];
@@ -1703,6 +1707,10 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
for (U32 i = 0; i < count; ++i)
{
LLJoint* joint = avatar->getJoint(skin->mJointNames[i]);
if(!joint)
{
joint = avatar->getJoint("mRoot");
}
if (joint)
{
mat[i] = skin->mInvBindMatrix[i];