forked from RobLoach/raylib-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMesh.hpp
More file actions
90 lines (76 loc) · 2.02 KB
/
Mesh.hpp
File metadata and controls
90 lines (76 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef RAYLIB_CPP_INCLUDE_MESH_HPP_
#define RAYLIB_CPP_INCLUDE_MESH_HPP_
#include <string>
#include <vector>
#include "./MeshUnmanaged.hpp"
#include "./Model.hpp"
#include "./raylib-cpp-utils.hpp"
#include "./raylib.hpp"
namespace raylib {
/**
* Vertex data defining a mesh
*
* The Mesh will be unloaded on object destruction.
*
* @see raylib::MeshUnmanaged
*/
class Mesh : public MeshUnmanaged {
public:
using MeshUnmanaged::MeshUnmanaged;
/**
* Explicitly forbid the copy constructor.
*/
Mesh(const Mesh&) = delete;
/**
* Explicitly forbid copy assignment.
*/
Mesh& operator=(const Mesh&) = delete;
/**
* Move constructor.
*/
Mesh(Mesh&& other) noexcept {
set(other);
other.vertexCount = 0;
other.triangleCount = 0;
other.vertices = nullptr;
other.texcoords = nullptr;
other.texcoords2 = nullptr;
other.normals = nullptr;
other.tangents = nullptr;
other.colors = nullptr;
other.indices = nullptr;
other.animVertices = nullptr;
other.animNormals = nullptr;
other.boneIndices = nullptr;
other.boneWeights = nullptr;
other.vaoId = 0;
other.vboId = nullptr;
}
Mesh& operator=(Mesh&& other) noexcept {
if (this == &other) {
return *this;
}
Unload();
set(other);
other.vertexCount = 0;
other.triangleCount = 0;
other.vertices = nullptr;
other.texcoords = nullptr;
other.texcoords2 = nullptr;
other.normals = nullptr;
other.tangents = nullptr;
other.colors = nullptr;
other.indices = nullptr;
other.animVertices = nullptr;
other.animNormals = nullptr;
other.boneIndices = nullptr;
other.boneWeights = nullptr;
other.vaoId = 0;
other.vboId = nullptr;
return *this;
}
~Mesh() { Unload(); }
};
} // namespace raylib
using RMesh = raylib::Mesh;
#endif // RAYLIB_CPP_INCLUDE_MESH_HPP_