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


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




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

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_ogre_1_1_simple_spline_a647c5b1ef7ab486fc8646fa6a151bab6}{Simple\+Spline}} ()
\item 
\mbox{\hyperlink{class_ogre_1_1_simple_spline_aef641d97c1f208faf7bcf46584706fd8}{$\sim$\+Simple\+Spline}} ()
\item 
void \mbox{\hyperlink{class_ogre_1_1_simple_spline_a19945294aede4d865da85ccbe095ad33}{add\+Point}} (const \mbox{\hyperlink{namespace_ogre_ac94fc4008c1165dea017263fee56b273}{Vector3}} \&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_simple_spline_ad9b46f66661afbebf4cf1c45182e0484}{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_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 \mbox{\hyperlink{namespace_ogre_ac94fc4008c1165dea017263fee56b273}{Vector3}} \& \mbox{\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 
\mbox{\hyperlink{namespace_ogre_ac94fc4008c1165dea017263fee56b273}{Vector3}} \mbox{\hyperlink{class_ogre_1_1_simple_spline_a11afeab4c4889cbfb34a439b9415b09f}{interpolate}} (\mbox{\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 
\mbox{\hyperlink{namespace_ogre_ac94fc4008c1165dea017263fee56b273}{Vector3}} \mbox{\hyperlink{class_ogre_1_1_simple_spline_abb942e88e6e7ef6466688d1fafc1f746}{interpolate}} (unsigned int from\+Index, \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\hyperlink{class_ogre_1_1_simple_spline_a5c757c1a320a61e224753b72c5e65048}{update\+Point}} (unsigned short index, const \mbox{\hyperlink{namespace_ogre_ac94fc4008c1165dea017263fee56b273}{Vector3}} \&value)
\begin{DoxyCompactList}\small\item\em Updates a single point in the spline. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{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}


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



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