group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
FbxImportUtils.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#ifdef __GNUC__
7#pragma GCC diagnostic push
8#pragma GCC diagnostic ignored "-Wconversion"
9#pragma GCC diagnostic ignored "-Wshadow"
10#pragma GCC diagnostic ignored "-Wpedantic"
11#pragma GCC diagnostic ignored "-Wdouble-promotion"
12#endif
13#include <assimp/matrix4x4.h>
14#include <assimp/scene.h>
15#ifdef __GNUC__
16#pragma GCC diagnostic pop
17#endif
18
19#ifdef __GNUC__
20#pragma GCC diagnostic push
21#pragma GCC diagnostic ignored "-Wconversion"
22#pragma GCC diagnostic ignored "-Wold-style-cast"
23#pragma GCC diagnostic ignored "-Wsign-conversion"
24#endif
25#include <ozz/animation/offline/raw_skeleton.h>
26#include <ozz/base/maths/quaternion.h>
27#include <ozz/base/maths/simd_math.h>
28#include <ozz/base/maths/vec_float.h>
29#ifdef __GNUC__
30#pragma GCC diagnostic pop
31#endif
32
33#include <glm/glm.hpp>
34#include <string>
35#include <unordered_map>
36#include <unordered_set>
37
38namespace anim_utils
39{
40
44{
45 ozz::math::Float3 translation{0, 0, 0};
46 ozz::math::Quaternion rotation{0, 0, 0, 1};
47 ozz::math::Float3 scale{1, 1, 1};
48};
49
53glm::mat4 ozzToGlm(const ozz::math::Float4x4& m);
54
58glm::mat4 aiToGlm(const aiMatrix4x4& m);
59
70bool buildJoint(const aiNode* node,
71 const std::unordered_set<std::string>& boneNames,
72 ozz::animation::offline::RawSkeleton::Joint& outJoint,
73 std::unordered_map<std::string, JointRestPose>& restPoses);
74
75} // namespace anim_utils
Definition FbxImportUtils.cpp:9
glm::mat4 ozzToGlm(const ozz::math::Float4x4 &m)
Convert an ozz SIMD 4x4 matrix to a GLM column-major mat4.
Definition FbxImportUtils.cpp:11
glm::mat4 aiToGlm(const aiMatrix4x4 &m)
Convert an Assimp row-major 4x4 matrix to GLM column-major.
Definition FbxImportUtils.cpp:22
bool buildJoint(const aiNode *node, const std::unordered_set< std::string > &boneNames, ozz::animation::offline::RawSkeleton::Joint &outJoint, std::unordered_map< std::string, JointRestPose > &restPoses)
Recursively build a RawSkeleton joint tree from the Assimp node hierarchy.
Definition FbxImportUtils.cpp:27
Rest-pose local transform cached during skeleton building, reused as a fallback keyframe for joints w...
Definition FbxImportUtils.hpp:44
ozz::math::Float3 scale
Definition FbxImportUtils.hpp:47
ozz::math::Quaternion rotation
Definition FbxImportUtils.hpp:46
ozz::math::Float3 translation
Definition FbxImportUtils.hpp:45