\hypertarget{classSkinT}{}\section{SkinT$<$ MeshT $>$ Class Template Reference}
\label{classSkinT}\index{Skin\+T$<$ Mesh\+T $>$@{Skin\+T$<$ Mesh\+T $>$}}


General skin class, used to bind skeleton and mesh and deform the mesh.  




{\ttfamily \#include $<$Type-\/\+Skeleton/\+Object\+Types/\+Skeleton/\+Skin\+T.\+hh$>$}

Inheritance diagram for SkinT$<$ MeshT $>$\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classSkinT}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classSkinT_a9db7d814001a85c6e08aeea08c9339b9}\label{classSkinT_a9db7d814001a85c6e08aeea08c9339b9}} 
typedef Mesh\+T\+::\+Point {\bfseries PointT}
\item 
\mbox{\Hypertarget{classSkinT_a08853aa48caab63443b1b96ba7f921e4}\label{classSkinT_a08853aa48caab63443b1b96ba7f921e4}} 
typedef PointT {\bfseries Point}
\item 
\mbox{\Hypertarget{classSkinT_ae06e7eb7fb2b5665d4427a17f3fcec5b}\label{classSkinT_ae06e7eb7fb2b5665d4427a17f3fcec5b}} 
typedef Point\+T\+::value\+\_\+type {\bfseries Scalar}
\item 
\mbox{\Hypertarget{classSkinT_a521574e7e218f95d3f5a0becc0ef21c9}\label{classSkinT_a521574e7e218f95d3f5a0becc0ef21c9}} 
typedef \hyperlink{classSkeletonT}{SkeletonT}$<$ PointT $>$ {\bfseries Skeleton}
\item 
\mbox{\Hypertarget{classSkinT_ad01c19523be62b71da1b6977c44f1009}\label{classSkinT_ad01c19523be62b71da1b6977c44f1009}} 
typedef \hyperlink{classJointT}{JointT}$<$ PointT $>$ {\bfseries Joint}
\item 
\mbox{\Hypertarget{classSkinT_a2c817ce6498bcd823998b9050d781433}\label{classSkinT_a2c817ce6498bcd823998b9050d781433}} 
typedef \hyperlink{classPoseT}{PoseT}$<$ PointT $>$ {\bfseries Pose}
\item 
\mbox{\Hypertarget{classSkinT_a641671810b6e0cbc9a17dcaf736a13bf}\label{classSkinT_a641671810b6e0cbc9a17dcaf736a13bf}} 
typedef \hyperlink{classACG_1_1Matrix4x4T}{A\+C\+G\+::\+Matrix4x4T}$<$ Scalar $>$ {\bfseries Matrix}
\item 
\mbox{\Hypertarget{classSkinT_a53ce18b2434577e3385c1add79904f92}\label{classSkinT_a53ce18b2434577e3385c1add79904f92}} 
typedef \hyperlink{classACG_1_1QuaternionT}{A\+C\+G\+::\+QuaternionT}$<$ Scalar $>$ {\bfseries Quaternion}
\item 
\mbox{\Hypertarget{classSkinT_a7c979e6ed901260b9ce3890b39b6f34d}\label{classSkinT_a7c979e6ed901260b9ce3890b39b6f34d}} 
typedef \hyperlink{classACG_1_1DualQuaternionT}{A\+C\+G\+::\+Dual\+QuaternionT}$<$ Scalar $>$ {\bfseries Dual\+Quaternion}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classSkinT_a486ab46b06056153c0ea631d7c8dc9f4}{SkinT} (\hyperlink{classSkeletonT}{SkeletonT}$<$ PointT $>$ $\ast$\+\_\+skeleton, MeshT $\ast$\+\_\+mesh, int \+\_\+object\+ID)
\begin{DoxyCompactList}\small\item\em constructor \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classSkinT_ab80659c8cdc3506263565a16209186be}\label{classSkinT_ab80659c8cdc3506263565a16209186be}} 
\hyperlink{classSkeletonT}{Skeleton} $\ast$ {\bfseries skeleton} ()
\item 
\mbox{\Hypertarget{classSkinT_a48d339b08de8fb1d3c2e794f0b4d51dd}\label{classSkinT_a48d339b08de8fb1d3c2e794f0b4d51dd}} 
void \hyperlink{classSkinT_a48d339b08de8fb1d3c2e794f0b4d51dd}{weights\+Computed} (bool \+\_\+flag)
\begin{DoxyCompactList}\small\item\em Set whether weights are computed. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classSkinT_ae307974dab5e924f0340212658c9a59f}\label{classSkinT_ae307974dab5e924f0340212658c9a59f}} 
bool \hyperlink{classSkinT_ae307974dab5e924f0340212658c9a59f}{weights\+Computed} () const
\begin{DoxyCompactList}\small\item\em Check whether weights were computed. \end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{Indent}\textbf{ Skinning}\par
{\em These methods are related to using a mesh as skin with this skeleton. }\begin{DoxyCompactItemize}
\item 
void \hyperlink{classSkinT_ad4bc769a57eacc4b47c240633665e94d}{attach\+Skin} ()
\begin{DoxyCompactList}\small\item\em Attach the given mesh as skin to this skeleton. \end{DoxyCompactList}\item 
void \hyperlink{classSkinT_a47a22d62419056c47a431c9f09534788}{deform\+Skin} ()
\begin{DoxyCompactList}\small\item\em Attach the given mesh as skin to this skeleton. \end{DoxyCompactList}\item 
void \hyperlink{classSkinT_a602ab414d22345d1e2133b6901f93895}{deform\+Skin} (const \hyperlink{classAnimationHandle}{Animation\+Handle} \&\+\_\+h\+Ani, Blending\+::\+Method \+\_\+method=Blending\+::\+M\+\_\+\+L\+BS)
\begin{DoxyCompactList}\small\item\em Deforms the given skin to the pose defined by the skeleton. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classSkinT_a9f6a2a9a150949d179fe209d58615e49}\label{classSkinT_a9f6a2a9a150949d179fe209d58615e49}} 
void \hyperlink{classSkinT_a9f6a2a9a150949d179fe209d58615e49}{release\+Skin} ()
\begin{DoxyCompactList}\small\item\em The given mesh will be reset to its default pose and all skin properties are removed. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classSkinT_a4fc2372da4d3191608b690497aea8018}\label{classSkinT_a4fc2372da4d3191608b690497aea8018}} 
\hyperlink{classSkeletonT}{Skeleton} $\ast$ {\bfseries skeleton\+\_\+}
\item 
\mbox{\Hypertarget{classSkinT_a1afb4508c5b8f04536cb8b204608f3c8}\label{classSkinT_a1afb4508c5b8f04536cb8b204608f3c8}} 
MeshT $\ast$ {\bfseries mesh\+\_\+}
\item 
\mbox{\Hypertarget{classSkinT_ac933d4936870d267773162331f147d8a}\label{classSkinT_ac933d4936870d267773162331f147d8a}} 
int {\bfseries object\+Id\+\_\+}
\item 
\mbox{\Hypertarget{classSkinT_a4c3eaf0bd7eaa6d915559599472734dc}\label{classSkinT_a4c3eaf0bd7eaa6d915559599472734dc}} 
\hyperlink{classAnimationHandle}{Animation\+Handle} {\bfseries last\+Animation\+Handle\+\_\+}
\item 
\mbox{\Hypertarget{classSkinT_abc49d04ab91608b9ea0d971efbf6757b}\label{classSkinT_abc49d04ab91608b9ea0d971efbf6757b}} 
Blending\+::\+Method {\bfseries lastmethod\+\_\+}
\item 
\mbox{\Hypertarget{classSkinT_a4abf28c76ab62f3aadabd1f3a3b5ad6b}\label{classSkinT_a4abf28c76ab62f3aadabd1f3a3b5ad6b}} 
bool {\bfseries weights\+Computed\+\_\+}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename MeshT$>$\newline
class Skin\+T$<$ Mesh\+T $>$}

General skin class, used to bind skeleton and mesh and deform the mesh. 

The mesh is given to the constructor. To prepare the mesh for deformation, call the Skin\+T\+::\+Attach\+Skin method. 

Definition at line 14 of file Skin\+T.\+hh.



\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classSkinT_a486ab46b06056153c0ea631d7c8dc9f4}\label{classSkinT_a486ab46b06056153c0ea631d7c8dc9f4}} 
\index{SkinT@{SkinT}!SkinT@{SkinT}}
\index{SkinT@{SkinT}!SkinT@{SkinT}}
\subsubsection{\texorpdfstring{Skin\+T()}{SkinT()}}
{\footnotesize\ttfamily template$<$typename MeshT $>$ \\
\hyperlink{classSkinT}{SkinT}$<$ MeshT $>$\+::\hyperlink{classSkinT}{SkinT} (\begin{DoxyParamCaption}\item[{\hyperlink{classSkeletonT}{SkeletonT}$<$ PointT $>$ $\ast$}]{\+\_\+skeleton,  }\item[{MeshT $\ast$}]{\+\_\+mesh,  }\item[{int}]{\+\_\+object\+ID }\end{DoxyParamCaption})}



constructor 


\begin{DoxyParams}{Parameters}
{\em \+\_\+skeleton} & Pointer to the skeleton which will be skinned \\
\hline
{\em \+\_\+mesh} & Pointer to the mesh that is the skin \\
\hline
{\em \+\_\+object\+ID} & Object\+Id of the Skeleton \\
\hline
\end{DoxyParams}


Definition at line 61 of file Skin\+T\+\_\+impl.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{classSkinT_ad4bc769a57eacc4b47c240633665e94d}\label{classSkinT_ad4bc769a57eacc4b47c240633665e94d}} 
\index{SkinT@{SkinT}!attach\+Skin@{attach\+Skin}}
\index{attach\+Skin@{attach\+Skin}!SkinT@{SkinT}}
\subsubsection{\texorpdfstring{attach\+Skin()}{attachSkin()}}
{\footnotesize\ttfamily template$<$typename MeshT $>$ \\
void \hyperlink{classSkinT}{SkinT}$<$ MeshT $>$\+::attach\+Skin (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Attach the given mesh as skin to this skeleton. 

The mesh will be equipped with two properties. One holding the original vertex coordinates, a second holding the per vertex weights for the joints. The bone weights are derived from the segment information stored with the bones and in a vertex based mesh property called \char`\"{}\+Face Segment\char`\"{}. 

Implements \hyperlink{classBaseSkin}{Base\+Skin}.



Definition at line 99 of file Skin\+T\+\_\+impl.\+hh.

\mbox{\Hypertarget{classSkinT_a47a22d62419056c47a431c9f09534788}\label{classSkinT_a47a22d62419056c47a431c9f09534788}} 
\index{SkinT@{SkinT}!deform\+Skin@{deform\+Skin}}
\index{deform\+Skin@{deform\+Skin}!SkinT@{SkinT}}
\subsubsection{\texorpdfstring{deform\+Skin()}{deformSkin()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename MeshT $>$ \\
void \hyperlink{classSkinT}{SkinT}$<$ MeshT $>$\+::deform\+Skin (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Attach the given mesh as skin to this skeleton. 

The mesh will be equipped with two properties. One holding the original vertex coordinates, a second holding the per vertex weights for the joints. The bone weights are derived from the segment information stored with the bones and in a vertex based mesh property called \char`\"{}\+Face Segment\char`\"{}. 

Implements \hyperlink{classBaseSkin}{Base\+Skin}.



Definition at line 120 of file Skin\+T\+\_\+impl.\+hh.

\mbox{\Hypertarget{classSkinT_a602ab414d22345d1e2133b6901f93895}\label{classSkinT_a602ab414d22345d1e2133b6901f93895}} 
\index{SkinT@{SkinT}!deform\+Skin@{deform\+Skin}}
\index{deform\+Skin@{deform\+Skin}!SkinT@{SkinT}}
\subsubsection{\texorpdfstring{deform\+Skin()}{deformSkin()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename MeshT $>$ \\
void \hyperlink{classSkinT}{SkinT}$<$ MeshT $>$\+::deform\+Skin (\begin{DoxyParamCaption}\item[{const \hyperlink{classAnimationHandle}{Animation\+Handle} \&}]{\+\_\+h\+Ani,  }\item[{Blending\+::\+Method}]{\+\_\+method = {\ttfamily Blending\+:\+:M\+\_\+LBS} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Deforms the given skin to the pose defined by the skeleton. 

This method will only work properly if the mesh has been prepared to be a skin by a call of Skeleton\+T\+::\+Prepare\+Skin.

Two algorithms are implemented\+:
\begin{DoxyItemize}
\item Linear Blend Skinning (L\+BS) or Skeletal Space Deformation (S\+SD)
\item Spherical Blend Skinning (S\+BS), Ladislav Kavan and Jiri Zara\+: Spherical blend skinning, a real-\/time deformation of articulated models
\end{DoxyItemize}

\begin{DoxyParagraph}{Linear Blend Skinning}
Every vertex will be transformed by every joint with a non-\/null weight. First of all the vertex is transformed into the coordinate system of the joint, then it is transformed back to the global coordinate system of the pose given by the active frame in the given animation.
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
Since the mesh is given in the default pose the default pose joints are used to calculate the vertices position relative to the joint. Then they are transformed back into global coordinates using the joints in the current pose.
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
The global matrices of the default pose and animation are not updated by this method, make sure to update them before deforming the skin or the results will be unexpected.
\end{DoxyParagraph}
\[ v_{pose} = M_{pose} \cdot M^{-1}_{default} \cdot v_{default} \]


\begin{DoxyParams}{Parameters}
{\em \+\_\+h\+Ani} & The animation frame to be used as target \\
\hline
{\em \+\_\+method} & deformation method to be used \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{BaseSkin_8hh_source}{Base\+Skin.\+hh} 
\end{DoxySeeAlso}


Implements \hyperlink{classBaseSkin}{Base\+Skin}.



Definition at line 158 of file Skin\+T\+\_\+impl.\+hh.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
Type-\/\+Skeleton/\+Object\+Types/\+Skeleton/Skin\+T.\+hh\item 
Type-\/\+Skeleton/\+Object\+Types/\+Skeleton/Skin\+T\+\_\+impl.\+hh\end{DoxyCompactItemize}
