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


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




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

Inheritance diagram for Skin\+T$<$ Mesh\+T $>$\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{a01192}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a01192_a9db7d814001a85c6e08aeea08c9339b9}{typedef Mesh\+T\+::\+Point {\bfseries Point\+T}}\label{a01192_a9db7d814001a85c6e08aeea08c9339b9}

\item 
\hypertarget{a01192_a08853aa48caab63443b1b96ba7f921e4}{typedef Point\+T {\bfseries Point}}\label{a01192_a08853aa48caab63443b1b96ba7f921e4}

\item 
\hypertarget{a01192_ae06e7eb7fb2b5665d4427a17f3fcec5b}{typedef Point\+T\+::value\+\_\+type {\bfseries Scalar}}\label{a01192_ae06e7eb7fb2b5665d4427a17f3fcec5b}

\item 
\hypertarget{a01192_a521574e7e218f95d3f5a0becc0ef21c9}{typedef \hyperlink{a01190}{Skeleton\+T}$<$ Point\+T $>$ {\bfseries Skeleton}}\label{a01192_a521574e7e218f95d3f5a0becc0ef21c9}

\item 
\hypertarget{a01192_ad01c19523be62b71da1b6977c44f1009}{typedef \hyperlink{a00751}{Joint\+T}$<$ Point\+T $>$ {\bfseries Joint}}\label{a01192_ad01c19523be62b71da1b6977c44f1009}

\item 
\hypertarget{a01192_a2c817ce6498bcd823998b9050d781433}{typedef \hyperlink{a00996}{Pose\+T}$<$ Point\+T $>$ {\bfseries Pose}}\label{a01192_a2c817ce6498bcd823998b9050d781433}

\item 
\hypertarget{a01192_a641671810b6e0cbc9a17dcaf736a13bf}{typedef \hyperlink{a00797}{A\+C\+G\+::\+Matrix4x4\+T}$<$ Scalar $>$ {\bfseries Matrix}}\label{a01192_a641671810b6e0cbc9a17dcaf736a13bf}

\item 
\hypertarget{a01192_a53ce18b2434577e3385c1add79904f92}{typedef \hyperlink{a01092}{A\+C\+G\+::\+Quaternion\+T}$<$ Scalar $>$ {\bfseries Quaternion}}\label{a01192_a53ce18b2434577e3385c1add79904f92}

\item 
\hypertarget{a01192_a7c979e6ed901260b9ce3890b39b6f34d}{typedef \hyperlink{a00514}{A\+C\+G\+::\+Dual\+Quaternion\+T}\\*
$<$ Scalar $>$ {\bfseries Dual\+Quaternion}}\label{a01192_a7c979e6ed901260b9ce3890b39b6f34d}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{a01192_a486ab46b06056153c0ea631d7c8dc9f4}{Skin\+T} (\hyperlink{a01190}{Skeleton\+T}$<$ Point\+T $>$ $\ast$\+\_\+skeleton, Mesh\+T $\ast$\+\_\+mesh, int \+\_\+object\+I\+D)
\begin{DoxyCompactList}\small\item\em constructor \end{DoxyCompactList}\item 
\hypertarget{a01192_ab80659c8cdc3506263565a16209186be}{\hyperlink{a01190}{Skeleton} $\ast$ {\bfseries skeleton} ()}\label{a01192_ab80659c8cdc3506263565a16209186be}

\item 
\hypertarget{a01192_a48d339b08de8fb1d3c2e794f0b4d51dd}{void \hyperlink{a01192_a48d339b08de8fb1d3c2e794f0b4d51dd}{weights\+Computed} (bool \+\_\+flag)}\label{a01192_a48d339b08de8fb1d3c2e794f0b4d51dd}

\begin{DoxyCompactList}\small\item\em Set whether weights are computed. \end{DoxyCompactList}\item 
\hypertarget{a01192_a7a0b63f4905e10cd4e79626d9f2f7a24}{bool \hyperlink{a01192_a7a0b63f4905e10cd4e79626d9f2f7a24}{weights\+Computed} () const }\label{a01192_a7a0b63f4905e10cd4e79626d9f2f7a24}

\begin{DoxyCompactList}\small\item\em Check whether weights were computed. \end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{Indent}{\bf Skinning}\par
{\em These methods are related to using a mesh as skin with this skeleton. }\begin{DoxyCompactItemize}
\item 
void \hyperlink{a01192_ad4bc769a57eacc4b47c240633665e94d}{attach\+Skin} ()
\begin{DoxyCompactList}\small\item\em Attach the given mesh as skin to this skeleton. \end{DoxyCompactList}\item 
void \hyperlink{a01192_a47a22d62419056c47a431c9f09534788}{deform\+Skin} ()
\begin{DoxyCompactList}\small\item\em Attach the given mesh as skin to this skeleton. \end{DoxyCompactList}\item 
void \hyperlink{a01192_a93cdbb227c4f3fe8444f335a775beae1}{deform\+Skin} (const \hyperlink{a00286}{Animation\+Handle} \&\+\_\+h\+Ani, \hyperlink{a00343_aa6b6b207875c07b72cc4100e6559aed1}{Method} \+\_\+method=M\+\_\+\+L\+B\+S)
\begin{DoxyCompactList}\small\item\em Deforms the given skin to the pose defined by the skeleton. \end{DoxyCompactList}\item 
\hypertarget{a01192_a9f6a2a9a150949d179fe209d58615e49}{void \hyperlink{a01192_a9f6a2a9a150949d179fe209d58615e49}{release\+Skin} ()}\label{a01192_a9f6a2a9a150949d179fe209d58615e49}

\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 
\hypertarget{a01192_a4fc2372da4d3191608b690497aea8018}{\hyperlink{a01190}{Skeleton} $\ast$ {\bfseries skeleton\+\_\+}}\label{a01192_a4fc2372da4d3191608b690497aea8018}

\item 
\hypertarget{a01192_a1afb4508c5b8f04536cb8b204608f3c8}{Mesh\+T $\ast$ {\bfseries mesh\+\_\+}}\label{a01192_a1afb4508c5b8f04536cb8b204608f3c8}

\item 
\hypertarget{a01192_ac933d4936870d267773162331f147d8a}{int {\bfseries object\+Id\+\_\+}}\label{a01192_ac933d4936870d267773162331f147d8a}

\item 
\hypertarget{a01192_a4c3eaf0bd7eaa6d915559599472734dc}{\hyperlink{a00286}{Animation\+Handle} {\bfseries last\+Animation\+Handle\+\_\+}}\label{a01192_a4c3eaf0bd7eaa6d915559599472734dc}

\item 
\hypertarget{a01192_a58131a2659e44e37b428e44011ea3f55}{\hyperlink{a00343_aa6b6b207875c07b72cc4100e6559aed1}{Method} {\bfseries lastmethod\+\_\+}}\label{a01192_a58131a2659e44e37b428e44011ea3f55}

\item 
\hypertarget{a01192_a4abf28c76ab62f3aadabd1f3a3b5ad6b}{bool {\bfseries weights\+Computed\+\_\+}}\label{a01192_a4abf28c76ab62f3aadabd1f3a3b5ad6b}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Mesh\+T$>$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 12 of file Skin\+T.\+hh.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{a01192_a486ab46b06056153c0ea631d7c8dc9f4}{\index{Skin\+T@{Skin\+T}!Skin\+T@{Skin\+T}}
\index{Skin\+T@{Skin\+T}!Skin\+T@{Skin\+T}}
\subsubsection[{Skin\+T}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Mesh\+T $>$ {\bf Skin\+T}$<$ Mesh\+T $>$\+::{\bf Skin\+T} (
\begin{DoxyParamCaption}
\item[{{\bf Skeleton\+T}$<$ Point\+T $>$ $\ast$}]{\+\_\+skeleton, }
\item[{Mesh\+T $\ast$}]{\+\_\+mesh, }
\item[{int}]{\+\_\+object\+I\+D}
\end{DoxyParamCaption}
)}}\label{a01192_a486ab46b06056153c0ea631d7c8dc9f4}


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\+I\+D} & Object\+Id of the Skeleton \\
\hline
\end{DoxyParams}


Definition at line 61 of file Skin\+T.\+cc.



\subsection{Member Function Documentation}
\hypertarget{a01192_ad4bc769a57eacc4b47c240633665e94d}{\index{Skin\+T@{Skin\+T}!attach\+Skin@{attach\+Skin}}
\index{attach\+Skin@{attach\+Skin}!Skin\+T@{Skin\+T}}
\subsubsection[{attach\+Skin}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Mesh\+T $>$ void {\bf Skin\+T}$<$ Mesh\+T $>$\+::attach\+Skin (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{a01192_ad4bc769a57eacc4b47c240633665e94d}


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{a00343}{Base\+Skin}.



Definition at line 99 of file Skin\+T.\+cc.

\hypertarget{a01192_a47a22d62419056c47a431c9f09534788}{\index{Skin\+T@{Skin\+T}!deform\+Skin@{deform\+Skin}}
\index{deform\+Skin@{deform\+Skin}!Skin\+T@{Skin\+T}}
\subsubsection[{deform\+Skin}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Mesh\+T $>$ void {\bf Skin\+T}$<$ Mesh\+T $>$\+::deform\+Skin (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{a01192_a47a22d62419056c47a431c9f09534788}


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{a00343}{Base\+Skin}.



Definition at line 120 of file Skin\+T.\+cc.

\hypertarget{a01192_a93cdbb227c4f3fe8444f335a775beae1}{\index{Skin\+T@{Skin\+T}!deform\+Skin@{deform\+Skin}}
\index{deform\+Skin@{deform\+Skin}!Skin\+T@{Skin\+T}}
\subsubsection[{deform\+Skin}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Mesh\+T $>$ void {\bf Skin\+T}$<$ Mesh\+T $>$\+::deform\+Skin (
\begin{DoxyParamCaption}
\item[{const {\bf Animation\+Handle} \&}]{\+\_\+h\+Ani, }
\item[{{\bf Method}}]{\+\_\+method = {\ttfamily M\+\_\+LBS}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{a01192_a93cdbb227c4f3fe8444f335a775beae1}


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\+B\+S) or Skeletal Space Deformation (S\+S\+D)
\item Spherical Blend Skinning (S\+B\+S), 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{a02370_source}{Base\+Skin.\+hh} 
\end{DoxySeeAlso}


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



Definition at line 158 of file Skin\+T.\+cc.



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