Utility/Mesh: Add MeshSaver properly

Former-commit-id: 8f6c3db5e5cd208a6a7b0b330ef3d8722fe38696 [formerly c87b832ede1355a7a1526aae0bcb402d4265ead7]
Former-commit-id: 1efc45f812129e86c6907e71d4523d77a1ceda12
This commit is contained in:
Lynix 2016-07-12 08:11:25 +02:00
parent ab43085fe7
commit d641336654
2 changed files with 14 additions and 0 deletions

View File

@ -71,6 +71,7 @@ namespace Nz
friend MeshLibrary;
friend MeshLoader;
friend MeshManager;
friend MeshSaver;
friend class Utility;
public:
@ -126,6 +127,9 @@ namespace Nz
void RemoveSubMesh(const String& identifier);
void RemoveSubMesh(unsigned int index);
bool SaveToFile(const String& filePath, const MeshParams& params = MeshParams());
bool SaveToStream(Stream& stream, const String& format, const MeshParams& params = MeshParams());
void SetAnimation(const String& animationPath);
void SetMaterialCount(unsigned int matCount);
void SetMaterialData(unsigned int matIndex, ParameterList data);

View File

@ -606,6 +606,16 @@ namespace Nz
InvalidateAABB();
}
bool Mesh::SaveToFile(const String& filePath, const MeshParams& params)
{
return MeshSaver::SaveToFile(*this, filePath, params);
}
bool Mesh::SaveToStream(Stream& stream, const String& format, const MeshParams& params)
{
return MeshSaver::SaveToStream(*this, stream, format, params);
}
void Mesh::SetAnimation(const String& animationPath)
{
NazaraAssert(m_impl, "Mesh should be created first");