COGS
Computer Graphics Structures library
SkeletonAction.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_SKELETON_ACTION_H
7 #define COGS_SKELETON_ACTION_H
8 #include <glm/glm.hpp>
9 #include <glm/gtc/quaternion.hpp>
10 
11 #include <COGS/Interpolator.h>
12 #include <COGS/API.h>
13 
14 namespace cogs
15 {
16  class Skeleton;
17  struct SkeletonPose;
18  class BoneTransform;
19 
20 
21 
22  struct COGS_API SkeletonAction
23  {
24  struct RootChannels
25  {
26  Interpolator<glm::quat> rotation;
27  Interpolator<glm::vec3> position;
29  [[nodiscard]] bool IsEmpty() const;
30  };
31 
32  struct BoneChannels
33  {
34  Interpolator<glm::quat> rotation;
35  Interpolator<glm::vec3> offset;
36  Interpolator<glm::vec3> scaling;
37  Interpolator<float> length;
39  [[nodiscard]] bool IsEmpty() const;
41  void AdjustTransformToTime(float time, BoneTransform *out_trans) const;
43  [[nodiscard]] float GetDuration() const;
44  };
45 
47  [[nodiscard]] float GetDuration() const;
48 
50  [[nodiscard]] bool IsEmpty() const;
51 
53  void AdjustPoseToTime(float time, const Skeleton &target_skeleton, SkeletonPose *out_pose) const;
54 
56  [[nodiscard]] std::vector<SkeletonPose> BakePoseAnimation(const Skeleton &target_skeleton) const;
57 
58  std::string name;
59  std::string target;
60  float fps{ 1.0f };
61  RootChannels root_channels;
62  std::map<std::string, BoneChannels> bone_channels;
63  };
64 
65 }
66 #endif /* !COGS_SKELETON_ACTION_H */
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8