3#include <glm/glm.force.hpp>
4#include <alicorn/std/string.hpp>
5#include <alicorn/std.fast/unordered-map.hpp>
6#include <alicorn/boost/filesystem.hpp>
7#include <assimp/importer.hpp>
22 using Path_t = ::boost::filesystem::path;
23 using String_t = ::alicorn::extension::std::String;
24 using BoneLocals_t = ::alicorn::extension::std::fast::unordered_map<::std::string, aiMatrix4x4>;
25 using VertexWeight_t = ::std::pair<::std::string, float>;
26 using BoneWeights_t = ::std::map<unsigned int, ::std::vector<VertexWeight_t>>;
33 ::std::string ParentName;
34 ::glm::mat4 GlobalTransform;
35 ::glm::mat4 LocalTransform;
41 using Keys_t = ::std::vector<::std::pair<float, ::glm::mat4>>;
42 ::std::string BoneName;
51 uint64_t Hash =
static_cast<uint64_t
>(-1);
55 ::std::vector<VertexWeight_t> WeightBones;
60 String_t MaterialName;
64 using BoneListener_t = ::std::function<void(
const Bone &)>;
65 using FrameListener_t = ::std::function<void(
const Frames &)>;
66 using FaceListener_t = ::std::function<void(
const Face &)>;
69 void LoadSkeleton(
const BoneListener_t &);
70 void LoadGeometry(
const FaceListener_t &);
71 float LoadAnimation(
const FrameListener_t &);
74 static ::glm::mat4 aiMatrix4x4ToGlm(
const aiMatrix4x4 &);
75 static const ::aiScene * LoadFile(
const Path_t &, ::Assimp::Importer &);
76 static BoneLocals_t LoadBoneLocals(
const aiScene *
const);
77 static void LoadSkeleton(
const BoneListener_t &,
const BoneLocals_t &,
78 const aiNode *
const, const ::glm::mat4 & = ::glm::mat4{ 1.0f });
79 static BoneWeights_t LoadBoneWeights(
const aiMesh *
const);
80 void LoadSkin(
const FaceListener_t &,
const aiScene *,
const aiNode *);
81 static Frames::Keys_t BuildFrames(const ::std::vector<aiVectorKey> &,
82 const ::std::vector<aiQuatKey> &, const ::std::vector<aiVectorKey> &);
85 ::Assimp::Importer m_Importer;
86 const ::aiScene * m_pScene;
89 explicit Assimp(
const Path_t &);