Add missing assignment operator to aiBone

pull/1765/head
Turo Lamminen 2018-02-03 16:24:45 +02:00
parent a64d515505
commit 82980c8a9c
1 changed files with 26 additions and 0 deletions

View File

@ -270,6 +270,32 @@ struct aiBone
}
}
//! Assignment operator
aiBone &operator=(const aiBone& other)
{
if (this == &other) {
return *this;
}
mName = other.mName;
mNumWeights = other.mNumWeights;
mOffsetMatrix = other.mOffsetMatrix;
if (other.mWeights && other.mNumWeights)
{
if (mWeights) {
delete[] mWeights;
}
mWeights = new aiVertexWeight[mNumWeights];
::memcpy(mWeights,other.mWeights,mNumWeights * sizeof(aiVertexWeight));
}
return *this;
}
//! Destructor - deletes the array of vertex weights
~aiBone()
{