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


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




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

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_ogre_1_1_rotational_spline_ac8596d691089c7be12d2879dc5595cea}{Rotational\+Spline}} ()
\item 
\mbox{\hyperlink{class_ogre_1_1_rotational_spline_ae7c15794bdabda0d02fb2ce52b3e1ea9}{$\sim$\+Rotational\+Spline}} ()
\item 
void \mbox{\hyperlink{class_ogre_1_1_rotational_spline_a5ba4e31b2ec1aec5c6c2878440184709}{add\+Point}} (const \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\hyperlink{class_ogre_1_1_quaternion}{Quaternion}} \& \mbox{\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 
\mbox{\hyperlink{class_ogre_1_1_quaternion}{Quaternion}} \mbox{\hyperlink{class_ogre_1_1_rotational_spline_a4fd498ecda341877bed16614f99513f3}{interpolate}} (\mbox{\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 
\mbox{\hyperlink{class_ogre_1_1_quaternion}{Quaternion}} \mbox{\hyperlink{class_ogre_1_1_rotational_spline_a50e4fac029abebe1f318a80da015f544}{interpolate}} (unsigned int from\+Index, \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\hyperlink{class_ogre_1_1_rotational_spline_a8ee6d15c86ed31e61e04360d36f1fbf9}{update\+Point}} (unsigned short index, const \mbox{\hyperlink{class_ogre_1_1_quaternion}{Quaternion}} \&value)
\begin{DoxyCompactList}\small\item\em Updates a single point in the spline. \end{DoxyCompactList}\end{DoxyCompactItemize}


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

\begin{DoxyRemark}{Remarks}
Like the \mbox{\hyperlink{class_ogre_1_1_simple_spline}{Simple\+Spline}} class, this class is about interpolating values smoothly over a spline. Whilst \mbox{\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 \mbox{\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}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_ac8596d691089c7be12d2879dc5595cea}\label{class_ogre_1_1_rotational_spline_ac8596d691089c7be12d2879dc5595cea}} 
\index{Ogre::RotationalSpline@{Ogre::RotationalSpline}!RotationalSpline@{RotationalSpline}}
\index{RotationalSpline@{RotationalSpline}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{RotationalSpline()}{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::RotationalSpline@{Ogre::RotationalSpline}!````~RotationalSpline@{$\sim$RotationalSpline}}
\index{````~RotationalSpline@{$\sim$RotationalSpline}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{$\sim$RotationalSpline()}{~RotationalSpline()}}
{\footnotesize\ttfamily Ogre\+::\+Rotational\+Spline\+::$\sim$\+Rotational\+Spline (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_rotational_spline_a5ba4e31b2ec1aec5c6c2878440184709}\label{class_ogre_1_1_rotational_spline_a5ba4e31b2ec1aec5c6c2878440184709}} 
\index{Ogre::RotationalSpline@{Ogre::RotationalSpline}!addPoint@{addPoint}}
\index{addPoint@{addPoint}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{addPoint()}{addPoint()}}
{\footnotesize\ttfamily void Ogre\+::\+Rotational\+Spline\+::add\+Point (\begin{DoxyParamCaption}\item[{const \mbox{\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::RotationalSpline@{Ogre::RotationalSpline}!getPoint@{getPoint}}
\index{getPoint@{getPoint}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{getPoint()}{getPoint()}}
{\footnotesize\ttfamily const \mbox{\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::RotationalSpline@{Ogre::RotationalSpline}!getNumPoints@{getNumPoints}}
\index{getNumPoints@{getNumPoints}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{getNumPoints()}{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::RotationalSpline@{Ogre::RotationalSpline}!clear@{clear}}
\index{clear@{clear}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\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::RotationalSpline@{Ogre::RotationalSpline}!updatePoint@{updatePoint}}
\index{updatePoint@{updatePoint}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{updatePoint()}{updatePoint()}}
{\footnotesize\ttfamily void Ogre\+::\+Rotational\+Spline\+::update\+Point (\begin{DoxyParamCaption}\item[{unsigned short}]{index,  }\item[{const \mbox{\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::RotationalSpline@{Ogre::RotationalSpline}!interpolate@{interpolate}}
\index{interpolate@{interpolate}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{interpolate()}{interpolate()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_ogre_1_1_quaternion}{Quaternion}} Ogre\+::\+Rotational\+Spline\+::interpolate (\begin{DoxyParamCaption}\item[{\mbox{\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::RotationalSpline@{Ogre::RotationalSpline}!interpolate@{interpolate}}
\index{interpolate@{interpolate}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{interpolate()}{interpolate()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_ogre_1_1_quaternion}{Quaternion}} Ogre\+::\+Rotational\+Spline\+::interpolate (\begin{DoxyParamCaption}\item[{unsigned int}]{from\+Index,  }\item[{\mbox{\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::RotationalSpline@{Ogre::RotationalSpline}!setAutoCalculate@{setAutoCalculate}}
\index{setAutoCalculate@{setAutoCalculate}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{setAutoCalculate()}{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::RotationalSpline@{Ogre::RotationalSpline}!recalcTangents@{recalcTangents}}
\index{recalcTangents@{recalcTangents}!Ogre::RotationalSpline@{Ogre::RotationalSpline}}
\doxysubsubsection{\texorpdfstring{recalcTangents()}{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 
\mbox{\hyperlink{_ogre_rotational_spline_8h}{Ogre\+Rotational\+Spline.\+h}}\end{DoxyCompactItemize}
