Update FbxSkinningAccess.cpp

This commit is contained in:
张曾 2019-02-24 10:50:47 +08:00 committed by GitHub
parent e83d495fdc
commit 4d19577f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -76,6 +76,13 @@ FbxSkinningAccess::FbxSkinningAccess(const FbxMesh* pMesh, FbxScene* pScene, Fbx
}
for (int i = 0; i < controlPointCount; i++) {
vertexJointWeights[i] = vertexJointWeights[i].Normalized();
float flen = fabs(vertexJointWeights[i].x) + fabs(vertexJointWeights[i].y) +
fabs(vertexJointWeights[i].z) + fabs(vertexJointWeights[i].w);
float scale = 1.0 / flen;
vertexJointWeights[i].x = vertexJointWeights[i].x * scale;
vertexJointWeights[i].y = vertexJointWeights[i].y * scale;
vertexJointWeights[i].z = vertexJointWeights[i].z * scale;
vertexJointWeights[i].w = vertexJointWeights[i].w * scale;
}
}
}