Path Tracer
SkeletonMeshBuilder.h
Go to the documentation of this file.
1 
3 /*
4 Open Asset Import Library (assimp)
5 ----------------------------------------------------------------------
6 
7 Copyright (c) 2006-2020, assimp team
8 
9 
10 All rights reserved.
11 
12 Redistribution and use of this software in source and binary forms,
13 with or without modification, are permitted provided that the
14 following conditions are met:
15 
16 * Redistributions of source code must retain the above
17 copyright notice, this list of conditions and the
18 following disclaimer.
19 
20 * Redistributions in binary form must reproduce the above
21 copyright notice, this list of conditions and the
22 following disclaimer in the documentation and/or other
23 materials provided with the distribution.
24 
25 * Neither the name of the assimp team, nor the names of its
26 contributors may be used to endorse or promote products
27 derived from this software without specific prior
28 written permission of the assimp team.
29 
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 
42 ----------------------------------------------------------------------
43 */
44 
50 #pragma once
51 #ifndef AI_SKELETONMESHBUILDER_H_INC
52 #define AI_SKELETONMESHBUILDER_H_INC
53 
54 #ifdef __GNUC__
55 #pragma GCC system_header
56 #endif
57 
58 #include <assimp/mesh.h>
59 #include <vector>
60 
61 struct aiMaterial;
62 struct aiScene;
63 struct aiNode;
64 
65 namespace Assimp {
66 
67 // ---------------------------------------------------------------------------
73 class ASSIMP_API SkeletonMeshBuilder {
74 public:
75  // -------------------------------------------------------------------
84  SkeletonMeshBuilder(aiScene *pScene, aiNode *root = nullptr,
85  bool bKnobsOnly = false);
86 
87 protected:
88  // -------------------------------------------------------------------
94  void CreateGeometry(const aiNode *pNode);
95 
96  // -------------------------------------------------------------------
100 
101  // -------------------------------------------------------------------
104 
105 protected:
107  std::vector<aiVector3D> mVertices;
108 
110  struct Face {
111  unsigned int mIndices[3];
112  Face();
113  Face(unsigned int p0, unsigned int p1, unsigned int p2) {
114  mIndices[0] = p0;
115  mIndices[1] = p1;
116  mIndices[2] = p2;
117  }
118  };
119  std::vector<Face> mFaces;
120 
122  std::vector<aiBone *> mBones;
123 
124  bool mKnobsOnly;
125 };
126 
127 } // end of namespace Assimp
128 
129 #endif // AI_SKELETONMESHBUILDER_H_INC
aiNode
Definition: scene.h:85
Assimp::SkeletonMeshBuilder::CreateMesh
aiMesh * CreateMesh()
Assimp::SkeletonMeshBuilder::CreateMaterial
aiMaterial * CreateMaterial()
Assimp::SkeletonMeshBuilder::mVertices
std::vector< aiVector3D > mVertices
Definition: SkeletonMeshBuilder.h:107
Assimp::SkeletonMeshBuilder::Face
Definition: SkeletonMeshBuilder.h:110
aiMaterial
Data structure for a material.
Definition: material.h:672
mesh.h
Declares the data structures in which the imported geometry is returned by ASSIMP: aiMesh,...
Assimp::SkeletonMeshBuilder::mBones
std::vector< aiBone * > mBones
Definition: SkeletonMeshBuilder.h:122
Assimp::SkeletonMeshBuilder::SkeletonMeshBuilder
SkeletonMeshBuilder(aiScene *pScene, aiNode *root=nullptr, bool bKnobsOnly=false)
Assimp::SkeletonMeshBuilder
Definition: SkeletonMeshBuilder.h:73
Assimp::SkeletonMeshBuilder::CreateGeometry
void CreateGeometry(const aiNode *pNode)
Assimp
Definition: ai_assert.h:50
aiScene
Definition: scene.h:247
aiMesh
enum aiMorphingMethod
Definition: mesh.h:575