MCPcopy Create free account
hub / github.com/assimp/assimp / CompareBones

Function CompareBones

code/PostProcessing/FindInstancesProcess.cpp:80–100  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Compare the bones of two meshes

Source from the content-addressed store, hash-verified

78// ------------------------------------------------------------------------------------------------
79// Compare the bones of two meshes
80bool 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

Callers 1

ExecuteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected