COGS
Computer Graphics Structures library
Armature.h
1 /*
2  Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
3  Unauthorized copying of this file, via any medium is strictly prohibited
4  Proprietary and confidential
5 */
6 #ifndef COGS_ARMATURE_H
7 #define COGS_ARMATURE_H
8 #include <COGS/Mesh.h>
9 #include <COGS/Skeleton.h>
10 #include <COGS/SkeletonAction.h>
11 #include <COGS/API.h>
12 
13 namespace cogs
14 {
15 
16  struct COGS_API VertexSkinData
17  {
18  glm::ivec4 ids = glm::ivec4(-1);
19  glm::vec4 weights = glm::vec4(0.0f);
20  };
21 
22  using SkinningData = std::vector<cogs::VertexSkinData>;
23 
24 
25 
26  class COGS_API Armature : public cogs::Skeleton
27  {
28  public:
29  Armature() = default;
30  void ConvertSkinDataFromNodeToBoneIds(std::unordered_map<int, cogs::Bone *> bone_for_nodeid);
31 
32  void SetMesh(const Mesh &mesh, const SkinningData &skindata);
33 
34  const Mesh *GetMesh() const;
35  const SkinningData *GetSkinningData() const;
36 
37  private:
38  int32_t anim_frame_ = 0;
39  Mesh mesh_;
40  SkinningData skin_data_;
41 
42  };
43 
44 
45 }
46 
47 #endif /* !COGS_ARMATURE_H */
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
3D Graph structure, usually representing topology of a 3D model.
Definition: Skeleton.h:22