Files
NazaraEngine/include/Nazara/Graphics/Model.inl
SirLynix 5130a2ff84 Remove Config.hpp options and refactor headers
- Rename Config.hpp to Export.hpp
- Remove Debug.hpp and DebugOff.hpp (not used anymore)
2024-02-19 15:11:34 +01:00

29 lines
849 B
C++

// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Core/Error.hpp>
namespace Nz
{
inline std::size_t Model::GetSubMeshCount() const
{
return m_submeshes.size();
}
inline void Model::SetMaterial(std::size_t subMeshIndex, std::shared_ptr<MaterialInstance> material)
{
NazaraAssertFmt(subMeshIndex < m_submeshes.size(), "submesh index out of range ({0} >= {1})", subMeshIndex, m_submeshes.size());
NazaraAssert(material, "invalid material");
if (m_submeshes[subMeshIndex].material != material)
{
OnMaterialInvalidated(this, subMeshIndex, material);
m_submeshes[subMeshIndex].material = std::move(material);
OnElementInvalidated(this);
}
}
}