Files
Seele/src/Engine/Asset/MeshLoader.h
T

30 lines
908 B
C++
Raw Normal View History

2020-06-02 11:46:18 +02:00
#pragma once
#include "MinimalEngine.h"
#include "Containers/List.h"
2020-08-11 22:38:19 +02:00
#include <filesystem>
2020-06-02 11:46:18 +02:00
2020-10-03 11:00:10 +02:00
struct aiScene;
struct aiTexel;
2020-06-02 11:46:18 +02:00
namespace Seele
{
2021-04-01 16:40:14 +02:00
DECLARE_REF(Mesh)
DECLARE_REF(MeshAsset)
DECLARE_REF(MaterialAsset)
DECLARE_NAME_REF(Gfx, Graphics)
2020-06-02 11:46:18 +02:00
class MeshLoader
{
public:
MeshLoader(Gfx::PGraphics graphic);
~MeshLoader();
2020-06-08 01:44:47 +02:00
void importAsset(const std::filesystem::path& filePath);
2020-06-02 11:46:18 +02:00
private:
void loadMaterials(const aiScene* scene, Array<PMaterialAsset>& globalMaterials);
2021-04-01 16:40:14 +02:00
void loadTextures(const aiScene* scene, const std::filesystem::path& meshPath);
void loadGlobalMeshes(const aiScene* scene, Array<PMesh>& globalMeshes, const Array<PMaterialAsset>& materials);
2020-10-03 11:00:10 +02:00
void convertAssimpARGB(unsigned char* dst, aiTexel* src, uint32 numPixels);
2021-12-22 11:42:07 +01:00
void import(std::filesystem::path path, PMeshAsset meshAsset);
2020-06-02 11:46:18 +02:00
Gfx::PGraphics graphics;
};
2021-04-01 16:40:14 +02:00
DEFINE_REF(MeshLoader)
2020-06-02 11:46:18 +02:00
} // namespace Seele