Voltray Engine Docs
Loading...
Searching...
No Matches
MeshLoader.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5#include <memory>
6#include "../Graphics/Mesh.h"
7#include "IFormatLoader.h"
8
9namespace Engine::Loader
10{
20 {
21 public:
27 static std::shared_ptr<Mesh> LoadMesh(const std::string &filepath);
28
34 static std::vector<std::shared_ptr<Mesh>> LoadMeshes(const std::string &filepath);
35
41 static std::vector<MeshData> LoadMeshData(const std::string &filepath);
42
48 static bool IsFormatSupported(const std::string &filepath);
49
54 static std::vector<std::string> GetSupportedFormats();
55
60 static std::vector<std::pair<std::string, std::vector<std::string>>> GetLoaderInfo();
61
62 private:
68 static std::shared_ptr<IFormatLoader> GetLoaderForExtension(const std::string &extension);
69
75 static std::string GetFileExtension(const std::string &filepath);
76
81 static std::vector<std::shared_ptr<IFormatLoader>> GetAllLoaders();
82 };
83};
Main mesh loading facade that manages multiple format loaders.
Definition MeshLoader.h:20
static std::vector< std::string > GetSupportedFormats()
Get list of all supported file extensions.
Definition MeshLoader.cpp:81
static bool IsFormatSupported(const std::string &filepath)
Check if file format is supported.
Definition MeshLoader.cpp:75
static std::vector< std::shared_ptr< Mesh > > LoadMeshes(const std::string &filepath)
Load all meshes from file.
Definition MeshLoader.cpp:22
static std::shared_ptr< Mesh > LoadMesh(const std::string &filepath)
Load a single mesh from file (first mesh if file contains multiple)
Definition MeshLoader.cpp:10
static std::vector< MeshData > LoadMeshData(const std::string &filepath)
Load raw mesh data for custom processing.
Definition MeshLoader.cpp:52
static std::vector< std::pair< std::string, std::vector< std::string > > > GetLoaderInfo()
Get information about available loaders.
Definition MeshLoader.cpp:113
Definition IFormatLoader.h:9