1#ifndef _MODELLOADER_HPP_
2#define _MODELLOADER_HPP_
9#include <unordered_map>
26 template <
typename T>
class RefPtr;
40 using TextureCache = std::unordered_map<std::string, ::Sleak::Texture*>;
102 const std::string& filePath,
Skeleton* skeleton);
106 static void ProcessNode(aiNode* node,
const aiScene* scene,
107 GameObject* parent,
const std::string& directory,
112 static void ProcessNodeAnimated(aiNode* node,
const aiScene* scene,
113 GameObject* parent,
const std::string& directory,
117 std::vector<AnimationClip*>& clips);
125 const aiScene* scene,
126 const std::string& directory,
128 bool skinned =
false);
131 static ::Sleak::Texture* LoadMaterialTexture(aiMaterial* mat,
int type,
132 const aiScene* scene,
133 const std::string& directory,
137 static Skeleton* ExtractSkeleton(
const aiScene* scene);
139 static std::vector<AnimationClip*> ExtractAnimations(
const aiScene* scene,
142 static void BuildBoneHierarchy(
const aiNode* node,
Skeleton* skeleton,
145 static int BuildNodeTree(
const aiNode* node,
Skeleton* skeleton);
Represents a quaternion for 3D rotations.
static GameObject * Load(const std::string &filePath, const ModelLoadOptions &options={})
Imports a model file and returns the root of the resulting GameObject hierarchy.
static std::vector< AnimationClip * > LoadAnimationsOnly(const std::string &filePath, Skeleton *skeleton)
Load only animations from an FBX, reusing an existing skeleton.
Matrix< float, 4, 4 > Matrix4
Root namespace for everything the engine exposes.
std::unordered_map< std::string, ::Sleak::Texture * > TextureCache
Per-load texture cache to avoid loading the same texture file multiple times.
Math::Quaternion rotation