New game interface
This commit is contained in:
@@ -12,19 +12,24 @@ DECLARE_REF(Mesh)
|
||||
DECLARE_REF(MeshAsset)
|
||||
DECLARE_REF(Material)
|
||||
DECLARE_NAME_REF(Gfx, Graphics)
|
||||
struct MeshImportArgs
|
||||
{
|
||||
std::filesystem::path filePath;
|
||||
std::string importPath;
|
||||
};
|
||||
class MeshLoader
|
||||
{
|
||||
public:
|
||||
MeshLoader(Gfx::PGraphics graphic);
|
||||
~MeshLoader();
|
||||
void importAsset(const std::filesystem::path& filePath, const std::string& importPath);
|
||||
void importAsset(MeshImportArgs args);
|
||||
private:
|
||||
void loadMaterials(const aiScene* scene, Array<PMaterial>& globalMaterials);
|
||||
void loadTextures(const aiScene* scene, const std::filesystem::path& meshPath);
|
||||
void loadGlobalMeshes(const aiScene* scene, const Array<PMaterial>& materials, Array<PMesh>& globalMeshes, Component::Collider& collider);
|
||||
void convertAssimpARGB(unsigned char* dst, aiTexel* src, uint32 numPixels);
|
||||
|
||||
void import(std::filesystem::path path, PMeshAsset meshAsset);
|
||||
void import(MeshImportArgs args, PMeshAsset meshAsset);
|
||||
Gfx::PGraphics graphics;
|
||||
};
|
||||
DEFINE_REF(MeshLoader)
|
||||
|
||||
Reference in New Issue
Block a user