* Model type. * * The model will be unloaded on object destruction. Use raylib::ModelUnmanaged if you're looking to not unload. * * @see raylib::ModelUnmanaged */
| 13 | * @see raylib::ModelUnmanaged |
| 14 | */ |
| 15 | class Model : public ModelUnmanaged { |
| 16 | public: |
| 17 | using ModelUnmanaged::ModelUnmanaged; |
| 18 | |
| 19 | /** |
| 20 | * The Model constructor with a Mesh() is removed. |
| 21 | * |
| 22 | * Use `raylib::MeshUnmanaged` or `::Mesh` instead, as raylib will take ownership of the data. |
| 23 | * |
| 24 | * @see raylib::MeshUnmanaged |
| 25 | */ |
| 26 | Model(const raylib::Mesh& mesh) = delete; |
| 27 | |
| 28 | Model(const Model&) = delete; |
| 29 | Model& operator=(const Model&) = delete; |
| 30 | |
| 31 | Model(Model&& other) noexcept { |
| 32 | set(other); |
| 33 | other.meshCount = 0; |
| 34 | other.materialCount = 0; |
| 35 | other.meshes = nullptr; |
| 36 | other.materials = nullptr; |
| 37 | other.meshMaterial = nullptr; |
| 38 | other.skeleton.boneCount = 0; |
| 39 | other.skeleton.bones = nullptr; |
| 40 | other.skeleton.bindPose = nullptr; |
| 41 | other.currentPose = nullptr; |
| 42 | other.boneMatrices = nullptr; |
| 43 | } |
| 44 | |
| 45 | Model& operator=(Model&& other) noexcept { |
| 46 | if (this == &other) { |
| 47 | return *this; |
| 48 | } |
| 49 | Unload(); |
| 50 | set(other); |
| 51 | other.meshCount = 0; |
| 52 | other.materialCount = 0; |
| 53 | other.meshes = nullptr; |
| 54 | other.materials = nullptr; |
| 55 | other.meshMaterial = nullptr; |
| 56 | other.skeleton.boneCount = 0; |
| 57 | other.skeleton.bones = nullptr; |
| 58 | other.skeleton.bindPose = nullptr; |
| 59 | other.currentPose = nullptr; |
| 60 | other.boneMatrices = nullptr; |
| 61 | return *this; |
| 62 | } |
| 63 | |
| 64 | Model& operator=(const ::Model& model) { |
| 65 | Unload(); |
| 66 | set(model); |
| 67 | return *this; |
| 68 | } |
| 69 | |
| 70 | ~Model() { Unload(); } |
| 71 | |
| 72 | void Load(const std::string& fileName) { |
nothing calls this directly
no outgoing calls
no test coverage detected