Radium Engine
1.5.20
|
#include <Core/Animation/Skeleton.hpp>
Public Types | |
enum | Manipulation { FORWARD = 0 , PSEUDO_IK } |
Public Types inherited from Ra::Core::Animation::HandleArray | |
enum class | SpaceType : bool { LOCAL , MODEL } |
Public Member Functions | |
Skeleton () | |
CONSTRUCTOR. | |
Skeleton (const uint n) | |
Skeleton (const Skeleton &skeleton)=default | |
uint | size () const override |
void | clear () override |
const Pose & | getPose (const SpaceType MODE) const override |
void | setPose (const Pose &pose, const SpaceType MODE) override |
const Transform & | getTransform (const uint i, const SpaceType MODE) const override |
void | setTransform (const uint i, const Transform &T, const SpaceType MODE) override |
uint | addRoot (const Transform &T=Transform::Identity(), const Label label="") |
uint | addBone (const uint parent, const Transform &T=Transform::Identity(), const SpaceType MODE=SpaceType::LOCAL, const Label label="") |
void | getBonePoints (uint i, Vector3 &startOut, Vector3 &endOut) const |
Vector3 | projectOnBone (uint boneIdx, const Vector3 &pos) const |
Projects point pos , given in Model Space, onto the bone with index boneIdx . | |
Public Member Functions inherited from Ra::Core::Animation::HandleArray | |
HandleArray (const uint n) | |
HandleArray (const HandleArray &handle)=default | |
HandleArray & | operator= (const HandleArray &handle)=default |
Label | getName () const |
void | setName (const Label &name) |
Label | getLabel (const uint i) const |
void | setLabel (const uint i, const Label &text) |
Public Attributes | |
AdjacencyList | m_graph |
The Joint hierarchy. | |
Manipulation | m_manipulation { FORWARD } |
The manipulation scheme. | |
Public Attributes inherited from Ra::Core::Animation::HandleArray | |
LocalPose | m_pose |
Protected Member Functions | |
void | setLocalTransform (uint i, const Transform &T) |
void | setModelTransform (uint i, const Transform &T) |
Protected Attributes | |
ModelPose | m_modelSpace |
Skeleton pose in MODEL space. | |
Protected Attributes inherited from Ra::Core::Animation::HandleArray | |
Label | m_name |
std::vector< Label > | m_label |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Skeleton &skeleton) |
Stream insertion operator. | |
The Skeleton class.
A skeleton is a set of joint transforms with an associated joint hierarchy, represented by a graph ( adjacency list ).
Skeleton bones represent a couple of joints: the proximal joint and the distal joint, the former being the parent of the latter in the hierarchy. For animation purposes, a bone transform refers to the proximal joint's tranform.
During the editing of the transformation of a skeleton bone, the transformations of all the bones are updated accroding to the Manipulation scheme (cf Ra::Core:Animation::Skeleton::Manipulation).
Definition at line 24 of file Skeleton.hpp.
Editing scheme for the manipulation of the skeleton.
Enumerator | |
---|---|
FORWARD | Standard editing scheme: rotation and / or translation of one bone. |
PSEUDO_IK | Advanced editing scheme: translation of a bone means parent's rotation. |
Definition at line 29 of file Skeleton.hpp.
Ra::Core::Animation::Skeleton::Skeleton | ( | ) |
CONSTRUCTOR.
Definition at line 12 of file Skeleton.cpp.
|
explicit |
Definition at line 14 of file Skeleton.cpp.
uint Ra::Core::Animation::Skeleton::addBone | ( | const uint | parent, |
const Transform & | T = Transform::Identity(), | ||
const SpaceType | MODE = SpaceType::LOCAL, | ||
const Label | label = "" ) |
Add a new joint transform to the skeleton.
parent | the index of the joint's parent in the hierarchy |
T | the joint transform associated to the new bone |
MODE | SpaceType of T (either SpaceType::LOCAL or SpaceType::MODEL) |
label | the name for the new joint |
Definition at line 149 of file Skeleton.cpp.
uint Ra::Core::Animation::Skeleton::addRoot | ( | const Transform & | T = Transform::Identity(), |
const Label | label = "" ) |
Add a new root transform to the skeleton.
T | the joint transform associated to the new bone |
label | the name for the new joint |
Definition at line 142 of file Skeleton.cpp.
|
overridevirtual |
Clear the transformations data
Reimplemented from Ra::Core::Animation::HandleArray.
Definition at line 16 of file Skeleton.cpp.
void Ra::Core::Animation::Skeleton::getBonePoints | ( | uint | i, |
Vector3 & | startOut, | ||
Vector3 & | endOut ) const |
Get the i-th bone endpoints in Model space.
i | the bone index | |
[out] | startOut | the bone's start point |
[out] | endOut | the bone's end point |
startOut
== endOut
. Definition at line 167 of file Skeleton.cpp.
MODE
space. Reimplemented from Ra::Core::Animation::HandleArray.
Definition at line 22 of file Skeleton.cpp.
|
overridevirtual |
i-th
transformation in MODE
space. Reimplemented from Ra::Core::Animation::HandleArray.
Definition at line 55 of file Skeleton.cpp.
Vector3 Ra::Core::Animation::Skeleton::projectOnBone | ( | uint | boneIdx, |
const Vector3 & | pos ) const |
Projects point pos
, given in Model Space, onto the bone with index boneIdx
.
Definition at line 186 of file Skeleton.cpp.
|
protected |
Sets the i-th
transform to T, given in Local space.
Definition at line 104 of file Skeleton.cpp.
|
protected |
Sets the i-th
transform to T, given in Model space.
Definition at line 123 of file Skeleton.cpp.
|
overridevirtual |
Set the current pose.
pose | the new pose |
MODE | the space the psoe lives in |
Reimplemented from Ra::Core::Animation::HandleArray.
Definition at line 29 of file Skeleton.cpp.
|
overridevirtual |
Set the i-th transform to T
, which is given in the MODE space, w.r.t. the current manipulation scheme and updates the whole Skeleton Pose.
Reimplemented from Ra::Core::Animation::HandleArray.
Definition at line 63 of file Skeleton.cpp.
|
inlineoverridevirtual |
Reimplemented from Ra::Core::Animation::HandleArray.
Definition at line 40 of file Skeleton.hpp.
|
friend |
Stream insertion operator.
Definition at line 201 of file Skeleton.cpp.
AdjacencyList Ra::Core::Animation::Skeleton::m_graph |
The Joint hierarchy.
Definition at line 106 of file Skeleton.hpp.
Manipulation Ra::Core::Animation::Skeleton::m_manipulation { FORWARD } |
The manipulation scheme.
Definition at line 109 of file Skeleton.hpp.
|
protected |
Skeleton pose in MODEL space.
Definition at line 113 of file Skeleton.hpp.