38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
#ifndef DESTRUM_ASSETMANAGER_H
|
|
#define DESTRUM_ASSETMANAGER_H
|
|
|
|
#include <filesystem>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
#include <destrum/Graphics/SkeletalAnimation.h>
|
|
#include <destrum/Graphics/Skeleton.h>
|
|
#include <destrum/Assets/AssetReference.h>
|
|
#include <destrum/Singleton.h>
|
|
#include <spdlog/spdlog.h>
|
|
#include <destrum/Util/ModelDoc.h>
|
|
|
|
class AssetManager final : public Singleton<AssetManager> {
|
|
public:
|
|
friend class Singleton<AssetManager>;
|
|
|
|
[[nodiscard]] std::filesystem::path Resolve(std::string_view reference) const;
|
|
|
|
[[nodiscard]] ModelDoc::ModelAsset LoadModel(
|
|
std::string_view reference,
|
|
const ModelDoc::LoadOptions& options = {}) const;
|
|
|
|
[[nodiscard]] std::vector<SkeletalAnimation> LoadAnimationClips(
|
|
std::string_view reference,
|
|
const Skeleton& targetSkeleton) const;
|
|
|
|
private:
|
|
AssetManager() = default;
|
|
|
|
[[nodiscard]] ModelDoc::ModelAsset LoadCookedOrImport(
|
|
const std::string& reference,
|
|
const ModelDoc::LoadOptions& options) const;
|
|
};
|
|
|
|
#endif // DESTRUM_ASSETMANAGER_H
|