Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.27
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Skeleton.hpp
1#pragma once
2
3#include <Core/Animation/HandleArray.hpp>
4#include <Core/Animation/Pose.hpp>
5#include <Core/Containers/AdjacencyList.hpp>
6#include <Core/CoreMacros.hpp>
7#include <Core/RaCore.hpp>
8#include <Core/Types.hpp>
9#include <iosfwd>
10#include <memory>
11
12namespace Ra {
13namespace Core {
14namespace Animation {
15
30class RA_CORE_API Skeleton : public HandleArray
31{
32 public:
36 FORWARD = 0,
37 PSEUDO_IK
38 };
39
40 Skeleton();
41 explicit Skeleton( const uint n );
42 Skeleton( const Skeleton& skeleton ) = default;
43
44 ~Skeleton() override = default;
45
46 inline uint size() const override { return m_graph.size(); }
47 void clear() override;
48 const Pose& getPose( const SpaceType MODE ) const override;
49 void setPose( const Pose& pose, const SpaceType MODE ) override;
50 const Transform& getTransform( const uint i, const SpaceType MODE ) const override;
51
56 void setTransform( const uint i, const Transform& T, const SpaceType MODE ) override;
57
64 uint addRoot( const Transform& T = Transform::Identity(), const Label label = "" );
65
74 uint addBone( const uint parent,
75 const Transform& T = Transform::Identity(),
76 const SpaceType MODE = SpaceType::LOCAL,
77 const Label label = "" );
78
87 void getBonePoints( uint i, Vector3& startOut, Vector3& endOut ) const;
88
90 Vector3 projectOnBone( uint boneIdx, const Vector3& pos ) const;
91
93 friend std::ostream& operator<<( std::ostream& os, const Skeleton& skeleton );
94
95 protected:
101 void setLocalTransform( uint i, const Transform& T );
102
108 void setModelTransform( uint i, const Transform& T );
109
110 public:
113
115 Manipulation m_manipulation { FORWARD };
116
117 protected:
120};
121
122} // namespace Animation
123} // Namespace Core
124} // Namespace Ra
ModelPose m_modelSpace
Skeleton pose in MODEL space.
Definition Skeleton.hpp:119
uint size() const override
Definition Skeleton.hpp:46
AdjacencyList m_graph
The Joint hierarchy.
Definition Skeleton.hpp:112
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:4