From 82980c8a9cd604e59a04251d74e8b8caa4ad401c Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Sat, 3 Feb 2018 16:24:45 +0200 Subject: [PATCH] Add missing assignment operator to aiBone --- include/assimp/mesh.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index a532e2b46..ea27d03a1 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -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() {