\hypertarget{class_ogre_1_1_simple_spline}{}\section{Ogre\+:\+:Simple\+Spline Class Reference}
\label{class_ogre_1_1_simple_spline}\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}


A very simple spline class which implements the Catmull-\/\+Rom class of splines.  




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

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_simple_spline_a647c5b1ef7ab486fc8646fa6a151bab6}{Simple\+Spline} ()
\item 
\hyperlink{class_ogre_1_1_simple_spline_aef641d97c1f208faf7bcf46584706fd8}{$\sim$\+Simple\+Spline} ()
\item 
void \hyperlink{class_ogre_1_1_simple_spline_a19945294aede4d865da85ccbe095ad33}{add\+Point} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&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_simple_spline_ad9b46f66661afbebf4cf1c45182e0484}{clear} (void)
\begin{DoxyCompactList}\small\item\em Clears all the points in the spline. \end{DoxyCompactList}\item 
unsigned short \hyperlink{class_ogre_1_1_simple_spline_a26d51ec5fca7e30d3b92a9f980e63667}{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_vector3}{Vector3} \& \hyperlink{class_ogre_1_1_simple_spline_a8edba215632d3c6c8322a57bb22a1b3a}{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_vector3}{Vector3} \hyperlink{class_ogre_1_1_simple_spline_a11afeab4c4889cbfb34a439b9415b09f}{interpolate} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} t) const
\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_vector3}{Vector3} \hyperlink{class_ogre_1_1_simple_spline_abb942e88e6e7ef6466688d1fafc1f746}{interpolate} (unsigned int from\+Index, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} t) const
\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_simple_spline_a2c8896ea995986b58328763e58acbcb0}{recalc\+Tangents} (void)
\begin{DoxyCompactList}\small\item\em Recalculates the tangents associated with this spline. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_simple_spline_ac8a0d23480006745e3a58ecec33f6bc2}{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_simple_spline_a5c757c1a320a61e224753b72c5e65048}{update\+Point} (unsigned short index, const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&value)
\begin{DoxyCompactList}\small\item\em Updates a single point in the spline. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A very simple spline class which implements the Catmull-\/\+Rom class of splines. 

\begin{DoxyRemark}{Remarks}
Splines are bendy lines. You define a series of points, and the spline forms a smoother line between the points to eliminate the sharp angles. 
\end{DoxyRemark}
\begin{DoxyParagraph}{}
Catmull-\/\+Rom splines are a specialisation of the general Hermite spline. With a Hermite spline, you define the start and end point of the line, and 2 tangents, one at the start of the line and one at the end. The Catmull-\/\+Rom spline simplifies this by just asking you to define a series of points, and the tangents are created for you. 
\end{DoxyParagraph}


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

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



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



Adds a control point to the end of the spline. 

\mbox{\Hypertarget{class_ogre_1_1_simple_spline_a8edba215632d3c6c8322a57bb22a1b3a}\label{class_ogre_1_1_simple_spline_a8edba215632d3c6c8322a57bb22a1b3a}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!get\+Point@{get\+Point}}
\index{get\+Point@{get\+Point}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{get\+Point()}{getPoint()}}
{\footnotesize\ttfamily const \hyperlink{class_ogre_1_1_vector3}{Vector3}\& Ogre\+::\+Simple\+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_simple_spline_a26d51ec5fca7e30d3b92a9f980e63667}\label{class_ogre_1_1_simple_spline_a26d51ec5fca7e30d3b92a9f980e63667}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!get\+Num\+Points@{get\+Num\+Points}}
\index{get\+Num\+Points@{get\+Num\+Points}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{get\+Num\+Points()}{getNumPoints()}}
{\footnotesize\ttfamily unsigned short Ogre\+::\+Simple\+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_simple_spline_ad9b46f66661afbebf4cf1c45182e0484}\label{class_ogre_1_1_simple_spline_ad9b46f66661afbebf4cf1c45182e0484}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!clear@{clear}}
\index{clear@{clear}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{clear()}{clear()}}
{\footnotesize\ttfamily void Ogre\+::\+Simple\+Spline\+::clear (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Clears all the points in the spline. 

\mbox{\Hypertarget{class_ogre_1_1_simple_spline_a5c757c1a320a61e224753b72c5e65048}\label{class_ogre_1_1_simple_spline_a5c757c1a320a61e224753b72c5e65048}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!update\+Point@{update\+Point}}
\index{update\+Point@{update\+Point}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{update\+Point()}{updatePoint()}}
{\footnotesize\ttfamily void Ogre\+::\+Simple\+Spline\+::update\+Point (\begin{DoxyParamCaption}\item[{unsigned short}]{index,  }\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{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_simple_spline_a11afeab4c4889cbfb34a439b9415b09f}\label{class_ogre_1_1_simple_spline_a11afeab4c4889cbfb34a439b9415b09f}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!interpolate@{interpolate}}
\index{interpolate@{interpolate}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{interpolate()}{interpolate()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_vector3}{Vector3} Ogre\+::\+Simple\+Spline\+::interpolate (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{t }\end{DoxyParamCaption}) const}



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
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_simple_spline_abb942e88e6e7ef6466688d1fafc1f746}\label{class_ogre_1_1_simple_spline_abb942e88e6e7ef6466688d1fafc1f746}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!interpolate@{interpolate}}
\index{interpolate@{interpolate}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{interpolate()}{interpolate()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_vector3}{Vector3} Ogre\+::\+Simple\+Spline\+::interpolate (\begin{DoxyParamCaption}\item[{unsigned int}]{from\+Index,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{t }\end{DoxyParamCaption}) const}



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
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_simple_spline_ac8a0d23480006745e3a58ecec33f6bc2}\label{class_ogre_1_1_simple_spline_ac8a0d23480006745e3a58ecec33f6bc2}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!set\+Auto\+Calculate@{set\+Auto\+Calculate}}
\index{set\+Auto\+Calculate@{set\+Auto\+Calculate}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{set\+Auto\+Calculate()}{setAutoCalculate()}}
{\footnotesize\ttfamily void Ogre\+::\+Simple\+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_simple_spline_a2c8896ea995986b58328763e58acbcb0}\label{class_ogre_1_1_simple_spline_a2c8896ea995986b58328763e58acbcb0}} 
\index{Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}!recalc\+Tangents@{recalc\+Tangents}}
\index{recalc\+Tangents@{recalc\+Tangents}!Ogre\+::\+Simple\+Spline@{Ogre\+::\+Simple\+Spline}}
\subsubsection{\texorpdfstring{recalc\+Tangents()}{recalcTangents()}}
{\footnotesize\ttfamily void Ogre\+::\+Simple\+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_simple_spline_8h}{Ogre\+Simple\+Spline.\+h}\end{DoxyCompactItemize}
