@@ -30,6 +30,28 @@ class Mesh : public ::Mesh {
3030 // return std::vector<Mesh>(meshes, meshes + count);
3131 // }
3232
33+ Mesh (const Mesh&) = delete ;
34+
35+ Mesh (Mesh&& other) {
36+ set (other);
37+
38+ other.vertexCount = 0 ;
39+ other.triangleCount = 0 ;
40+ other.vertices = nullptr ;
41+ other.texcoords = nullptr ;
42+ other.texcoords2 = nullptr ;
43+ other.normals = nullptr ;
44+ other.tangents = nullptr ;
45+ other.colors = nullptr ;
46+ other.indices = nullptr ;
47+ other.animVertices = nullptr ;
48+ other.animNormals = nullptr ;
49+ other.boneIds = nullptr ;
50+ other.boneWeights = nullptr ;
51+ other.vaoId = 0 ;
52+ other.vboId = nullptr ;
53+ }
54+
3355 /* *
3456 * Generate polygonal mesh
3557 */
@@ -121,6 +143,35 @@ class Mesh : public ::Mesh {
121143 return *this ;
122144 }
123145
146+ Mesh& operator =(const Mesh&) = delete ;
147+
148+ Mesh& operator =(Mesh&& other) {
149+ if (this != &other) {
150+ return *this ;
151+ }
152+
153+ Unload ();
154+ set (other);
155+
156+ other.vertexCount = 0 ;
157+ other.triangleCount = 0 ;
158+ other.vertices = nullptr ;
159+ other.texcoords = nullptr ;
160+ other.texcoords2 = nullptr ;
161+ other.normals = nullptr ;
162+ other.tangents = nullptr ;
163+ other.colors = nullptr ;
164+ other.indices = nullptr ;
165+ other.animVertices = nullptr ;
166+ other.animNormals = nullptr ;
167+ other.boneIds = nullptr ;
168+ other.boneWeights = nullptr ;
169+ other.vaoId = 0 ;
170+ other.vboId = nullptr ;
171+
172+ return *this ;
173+ }
174+
124175 ~Mesh () {
125176 Unload ();
126177 }
0 commit comments