\hypertarget{class_ogre_1_1_rotational_spline}{}\section{Ogre\+:\+:Rotational\+Spline Class Reference}
\label{class_ogre_1_1_rotational_spline}\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}


This class interpolates orientations (rotations) along a spline using derivatives of quaternions.  




{\ttfamily \#include $<$Ogre\+Rotational\+Spline.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_rotational_spline_ac8596d691089c7be12d2879dc5595cea}{Rotational\+Spline} ()
\item 
\hyperlink{class_ogre_1_1_rotational_spline_ae7c15794bdabda0d02fb2ce52b3e1ea9}{$\sim$\+Rotational\+Spline} ()
\item 
void \hyperlink{class_ogre_1_1_rotational_spline_a5ba4e31b2ec1aec5c6c2878440184709}{add\+Point} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&p)
\begin{DoxyCompactList}\small\item\em Adds a control point to the end of the spline. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_rotational_spline_ad52da70d8d76c5c6d2203197e14b3520}{clear} (void)
\begin{DoxyCompactList}\small\item\em Clears all the points in the spline. \end{DoxyCompactList}\item 
unsigned short \hyperlink{class_ogre_1_1_rotational_spline_a92446820612daa332226ab9bf18d7f6a}{get\+Num\+Points} (void) const
\begin{DoxyCompactList}\small\item\em Gets the number of control points in the spline. \end{DoxyCompactList}\item 
const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \& \hyperlink{class_ogre_1_1_rotational_spline_a40537aff8d0e9a31f2041bab0a6207e1}{get\+Point} (unsigned short index) const
\begin{DoxyCompactList}\small\item\em Gets the detail of one of the control points of the spline. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_rotational_spline_a4fd498ecda341877bed16614f99513f3}{interpolate} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} t, bool use\+Shortest\+Path=true)
\begin{DoxyCompactList}\small\item\em Returns an interpolated point based on a parametric value over the whole series. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_rotational_spline_a50e4fac029abebe1f318a80da015f544}{interpolate} (unsigned int from\+Index, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} t, bool use\+Shortest\+Path=true)
\begin{DoxyCompactList}\small\item\em Interpolates a single segment of the spline given a parametric value. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_rotational_spline_a9eec1f4d7ee25b15d435e8c49c69c92a}{recalc\+Tangents} (void)
\begin{DoxyCompactList}\small\item\em Recalculates the tangents associated with this spline. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_rotational_spline_a94645c3887ad1b0872bcea3897fae613}{set\+Auto\+Calculate} (bool auto\+Calc)
\begin{DoxyCompactList}\small\item\em Tells the spline whether it should automatically calculate tangents on demand as points are added. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_rotational_spline_a8ee6d15c86ed31e61e04360d36f1fbf9}{update\+Point} (unsigned short index, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&value)
\begin{DoxyCompactList}\small\item\em Updates a single point in the spline. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class interpolates orientations (rotations) along a spline using derivatives of quaternions. 

\begin{DoxyRemark}{Remarks}
Like the \hyperlink{class_ogre_1_1_simple_spline}{Simple\+Spline} class, this class is about interpolating values smoothly over a spline. Whilst \hyperlink{class_ogre_1_1_simple_spline}{Simple\+Spline} deals with positions (the normal sense we think about splines), this class interpolates orientations. The theory is identical, except we\textquotesingle{}re now in 4-\/dimensional space instead of 3. 
\end{DoxyRemark}
\begin{DoxyParagraph}{}
In positional splines, we use the points and tangents on those points to generate control points for the spline. In this case, we use quaternions and derivatives of the quaternions (i.\+e. the rate and direction of change at each point). This is the same as \hyperlink{class_ogre_1_1_simple_spline}{Simple\+Spline} since a tangent is a derivative of a position. We effectively generate an extra quaternion in between each actual quaternion which when take with the original quaternion forms the \textquotesingle{}tangent\textquotesingle{} of that quaternion. 
\end{DoxyParagraph}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_ac8596d691089c7be12d2879dc5595cea}\label{class_ogre_1_1_rotational_spline_ac8596d691089c7be12d2879dc5595cea}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!Rotational\+Spline@{Rotational\+Spline}}
\index{Rotational\+Spline@{Rotational\+Spline}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{Rotational\+Spline()}{RotationalSpline()}}
{\footnotesize\ttfamily Ogre\+::\+Rotational\+Spline\+::\+Rotational\+Spline (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_ae7c15794bdabda0d02fb2ce52b3e1ea9}\label{class_ogre_1_1_rotational_spline_ae7c15794bdabda0d02fb2ce52b3e1ea9}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!````~Rotational\+Spline@{$\sim$\+Rotational\+Spline}}
\index{````~Rotational\+Spline@{$\sim$\+Rotational\+Spline}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{$\sim$\+Rotational\+Spline()}{~RotationalSpline()}}
{\footnotesize\ttfamily Ogre\+::\+Rotational\+Spline\+::$\sim$\+Rotational\+Spline (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a5ba4e31b2ec1aec5c6c2878440184709}\label{class_ogre_1_1_rotational_spline_a5ba4e31b2ec1aec5c6c2878440184709}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!add\+Point@{add\+Point}}
\index{add\+Point@{add\+Point}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{add\+Point()}{addPoint()}}
{\footnotesize\ttfamily void Ogre\+::\+Rotational\+Spline\+::add\+Point (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{p }\end{DoxyParamCaption})}



Adds a control point to the end of the spline. 

\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a40537aff8d0e9a31f2041bab0a6207e1}\label{class_ogre_1_1_rotational_spline_a40537aff8d0e9a31f2041bab0a6207e1}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!get\+Point@{get\+Point}}
\index{get\+Point@{get\+Point}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{get\+Point()}{getPoint()}}
{\footnotesize\ttfamily const \hyperlink{class_ogre_1_1_quaternion}{Quaternion}\& Ogre\+::\+Rotational\+Spline\+::get\+Point (\begin{DoxyParamCaption}\item[{unsigned short}]{index }\end{DoxyParamCaption}) const}



Gets the detail of one of the control points of the spline. 

\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a92446820612daa332226ab9bf18d7f6a}\label{class_ogre_1_1_rotational_spline_a92446820612daa332226ab9bf18d7f6a}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!get\+Num\+Points@{get\+Num\+Points}}
\index{get\+Num\+Points@{get\+Num\+Points}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{get\+Num\+Points()}{getNumPoints()}}
{\footnotesize\ttfamily unsigned short Ogre\+::\+Rotational\+Spline\+::get\+Num\+Points (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const}



Gets the number of control points in the spline. 

\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_ad52da70d8d76c5c6d2203197e14b3520}\label{class_ogre_1_1_rotational_spline_ad52da70d8d76c5c6d2203197e14b3520}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!clear@{clear}}
\index{clear@{clear}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{clear()}{clear()}}
{\footnotesize\ttfamily void Ogre\+::\+Rotational\+Spline\+::clear (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Clears all the points in the spline. 

\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a8ee6d15c86ed31e61e04360d36f1fbf9}\label{class_ogre_1_1_rotational_spline_a8ee6d15c86ed31e61e04360d36f1fbf9}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!update\+Point@{update\+Point}}
\index{update\+Point@{update\+Point}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{update\+Point()}{updatePoint()}}
{\footnotesize\ttfamily void Ogre\+::\+Rotational\+Spline\+::update\+Point (\begin{DoxyParamCaption}\item[{unsigned short}]{index,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{value }\end{DoxyParamCaption})}



Updates a single point in the spline. 

\begin{DoxyRemark}{Remarks}
This point must already exist in the spline. 
\end{DoxyRemark}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a4fd498ecda341877bed16614f99513f3}\label{class_ogre_1_1_rotational_spline_a4fd498ecda341877bed16614f99513f3}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!interpolate@{interpolate}}
\index{interpolate@{interpolate}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{interpolate()}{interpolate()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Rotational\+Spline\+::interpolate (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{t,  }\item[{bool}]{use\+Shortest\+Path = {\ttfamily true} }\end{DoxyParamCaption})}



Returns an interpolated point based on a parametric value over the whole series. 

\begin{DoxyRemark}{Remarks}
Given a t value between 0 and 1 representing the parametric distance along the whole length of the spline, this method returns an interpolated point. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em t} & Parametric value. \\
\hline
{\em use\+Shortest\+Path} & Defines if rotation should take the shortest possible path \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a50e4fac029abebe1f318a80da015f544}\label{class_ogre_1_1_rotational_spline_a50e4fac029abebe1f318a80da015f544}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!interpolate@{interpolate}}
\index{interpolate@{interpolate}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{interpolate()}{interpolate()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Rotational\+Spline\+::interpolate (\begin{DoxyParamCaption}\item[{unsigned int}]{from\+Index,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{t,  }\item[{bool}]{use\+Shortest\+Path = {\ttfamily true} }\end{DoxyParamCaption})}



Interpolates a single segment of the spline given a parametric value. 


\begin{DoxyParams}{Parameters}
{\em from\+Index} & The point index to treat as t=0. from\+Index + 1 is deemed to be t=1 \\
\hline
{\em t} & Parametric value \\
\hline
{\em use\+Shortest\+Path} & Defines if rotation should take the shortest possible path \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a94645c3887ad1b0872bcea3897fae613}\label{class_ogre_1_1_rotational_spline_a94645c3887ad1b0872bcea3897fae613}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!set\+Auto\+Calculate@{set\+Auto\+Calculate}}
\index{set\+Auto\+Calculate@{set\+Auto\+Calculate}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{set\+Auto\+Calculate()}{setAutoCalculate()}}
{\footnotesize\ttfamily void Ogre\+::\+Rotational\+Spline\+::set\+Auto\+Calculate (\begin{DoxyParamCaption}\item[{bool}]{auto\+Calc }\end{DoxyParamCaption})}



Tells the spline whether it should automatically calculate tangents on demand as points are added. 

\begin{DoxyRemark}{Remarks}
The spline calculates tangents at each point automatically based on the input points. Normally it does this every time a point changes. However, if you have a lot of points to add in one go, you probably don\textquotesingle{}t want to incur this overhead and would prefer to defer the calculation until you are finished setting all the points. You can do this by calling this method with a parameter of \textquotesingle{}false\textquotesingle{}. Just remember to manually call the recalc\+Tangents method when you are done. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em auto\+Calc} & If true, tangents are calculated for you whenever a point changes. If false, you must call reclac\+Tangents to recalculate them when it best suits. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a9eec1f4d7ee25b15d435e8c49c69c92a}\label{class_ogre_1_1_rotational_spline_a9eec1f4d7ee25b15d435e8c49c69c92a}} 
\index{Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}!recalc\+Tangents@{recalc\+Tangents}}
\index{recalc\+Tangents@{recalc\+Tangents}!Ogre\+::\+Rotational\+Spline@{Ogre\+::\+Rotational\+Spline}}
\subsubsection{\texorpdfstring{recalc\+Tangents()}{recalcTangents()}}
{\footnotesize\ttfamily void Ogre\+::\+Rotational\+Spline\+::recalc\+Tangents (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Recalculates the tangents associated with this spline. 

\begin{DoxyRemark}{Remarks}
If you tell the spline not to update on demand by calling set\+Auto\+Calculate(false) then you must call this after completing your updates to the spline points. 
\end{DoxyRemark}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_rotational_spline_8h}{Ogre\+Rotational\+Spline.\+h}\end{DoxyCompactItemize}
