// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Graphics module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_GRAPHICS_MODEL_HPP #define NAZARA_GRAPHICS_MODEL_HPP #include #include #include #include #include #include #include #include namespace Nz { class Material; class NAZARA_GRAPHICS_API Model : public InstancedRenderable { public: Model(std::shared_ptr graphicalMesh, const Boxf& aabb); Model(const Model&) = delete; Model(Model&&) noexcept = default; ~Model() = default; void BuildElement(ElementRendererRegistry& registry, const ElementData& elementData, std::size_t passIndex, std::vector& elements) const override; const std::shared_ptr& GetIndexBuffer(std::size_t subMeshIndex) const; std::size_t GetIndexCount(std::size_t subMeshIndex) const; const std::shared_ptr& GetMaterial(std::size_t subMeshIndex) const override; std::size_t GetMaterialCount() const override; inline std::size_t GetSubMeshCount() const; const std::vector& GetVertexBufferData(std::size_t subMeshIndex) const; const std::shared_ptr& GetVertexBuffer(std::size_t subMeshIndex) const; inline void SetMaterial(std::size_t subMeshIndex, std::shared_ptr material); Model& operator=(const Model&) = delete; Model& operator=(Model&&) noexcept = default; private: struct SubMeshData { std::shared_ptr material; std::vector vertexBufferData; }; NazaraSlot(GraphicalMesh, OnInvalidated, m_onInvalidated); std::shared_ptr m_graphicalMesh; std::vector m_submeshes; Recti m_scissorBox; }; } #include #endif // NAZARA_GRAPHICS_MODEL_HPP