------------------------------------------------------------------------------------------------ Compare the bones of two meshes
| 78 | // ------------------------------------------------------------------------------------------------ |
| 79 | // Compare the bones of two meshes |
| 80 | bool CompareBones(const aiMesh* orig, const aiMesh* inst) |
| 81 | { |
| 82 | for (unsigned int i = 0; i < orig->mNumBones;++i) { |
| 83 | aiBone* aha = orig->mBones[i]; |
| 84 | aiBone* oha = inst->mBones[i]; |
| 85 | |
| 86 | if (aha->mNumWeights != oha->mNumWeights || |
| 87 | aha->mOffsetMatrix != oha->mOffsetMatrix) { |
| 88 | return false; |
| 89 | } |
| 90 | |
| 91 | // compare weight per weight --- |
| 92 | for (unsigned int n = 0; n < aha->mNumWeights;++n) { |
| 93 | if (aha->mWeights[n].mVertexId != oha->mWeights[n].mVertexId || |
| 94 | (aha->mWeights[n].mWeight - oha->mWeights[n].mWeight) < 10e-3f) { |
| 95 | return false; |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | return true; |
| 100 | } |
| 101 | |
| 102 | // ------------------------------------------------------------------------------------------------ |
| 103 | // Update mesh indices in the node graph |