Plasma Engine  2.0
Loading...
Searching...
No Matches
ImporterAssimp.h
1#pragma once
2
3#include <ModelImporter2/Importer/Importer.h>
4
5#include <assimp/Importer.hpp>
6
8struct aiNode;
9struct aiMesh;
10
11namespace plModelImporter2
12{
13 class ImporterAssimp : public Importer
14 {
15 public:
18
19 protected:
20 virtual plResult DoImport() override;
21
22 private:
23 plResult TraverseAiScene();
24
25 plResult PrepareOutputMesh();
26 plResult RecomputeTangents();
27
28 plResult TraverseAiNode(aiNode* pNode, const plMat4& parentTransform, plEditableSkeletonJoint* pCurJoint);
29 plResult ProcessAiMesh(aiMesh* pMesh, const plMat4& transform);
30
31 plResult ImportMaterials();
32 plResult ImportAnimations();
33
34 plResult ImportBoneColliders(plEditableSkeletonJoint* pJoint);
35
36 Assimp::Importer m_Importer;
37 const aiScene* m_pScene = nullptr;
38 plUInt32 m_uiTotalMeshVertices = 0;
39 plUInt32 m_uiTotalMeshTriangles = 0;
40
41 struct MeshInstance
42 {
43 plMat4 m_GlobalTransform;
44 aiMesh* m_pMesh;
45 };
46
48 };
49
50 extern plColor ConvertAssimpType(const aiColor3D& value, bool bInvert = false);
51 extern plColor ConvertAssimpType(const aiColor4D& value, bool bInvert = false);
52 extern plMat4 ConvertAssimpType(const aiMatrix4x4& value, bool bDummy = false);
53 extern plVec3 ConvertAssimpType(const aiVector3D& value, bool bDummy = false);
54 extern plQuat ConvertAssimpType(const aiQuaternion& value, bool bDummy = false);
55 extern float ConvertAssimpType(float value, bool bDummy = false);
56 extern int ConvertAssimpType(int value, bool bDummy = false);
57
58} // namespace plModelImporter2
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
Definition EditableSkeleton.h:49
Definition Map.h:408
Definition ImporterAssimp.h:14
Definition Importer.h:85
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54