\hypertarget{class_ogre_1_1_waveform_controller_function}{}\section{Ogre\+:\+:Waveform\+Controller\+Function Class Reference}
\label{class_ogre_1_1_waveform_controller_function}\index{Ogre\+::\+Waveform\+Controller\+Function@{Ogre\+::\+Waveform\+Controller\+Function}}


Predefined controller function based on a waveform.  




{\ttfamily \#include $<$Ogre\+Predefined\+Controllers.\+h$>$}



Inheritance diagram for Ogre\+:\+:Waveform\+Controller\+Function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=224pt]{class_ogre_1_1_waveform_controller_function__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_waveform_controller_function_a1b83f439aae8d785f1db065ac7e59139}{Waveform\+Controller\+Function} (\hyperlink{group___general_gabf2e0412a783a6f708ca1a58abb45c1b}{Waveform\+Type} w\+Type, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} base=0, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} frequency=1, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} phase=0, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} amplitude=1, bool delta\+Input=true, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} duty\+Cycle=0.\+5)
\begin{DoxyCompactList}\small\item\em Default constructor, requires at least a wave type, other parameters can be defaulted unless required. \end{DoxyCompactList}\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_waveform_controller_function_aec4afc09add54fd7872f78e299e1d276}{calculate} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} source)
\begin{DoxyCompactList}\small\item\em Overridden function. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Predefined controller function based on a waveform. 

\begin{DoxyRemark}{Remarks}
A waveform function translates parametric input to parametric output based on a wave. 
\end{DoxyRemark}
\begin{DoxyParagraph}{}
Note that for simplicity of integration with the rest of the controller insfrastructure, the output of the wave is parametric i.\+e. 0..1, rather than the typical wave output of \mbox{[}-\/1,1\mbox{]}. To compensate for this, the traditional output of the wave is scaled by the following function before output\+: 
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
output = (waveoutput + 1) $\ast$ 0.\+5 
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
Hence a wave output of -\/1 becomes 0, a wave output of 1 becomes 1, and a wave output of 0 becomes 0.\+5. 
\end{DoxyParagraph}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_waveform_controller_function_a1b83f439aae8d785f1db065ac7e59139}\label{class_ogre_1_1_waveform_controller_function_a1b83f439aae8d785f1db065ac7e59139}} 
\index{Ogre\+::\+Waveform\+Controller\+Function@{Ogre\+::\+Waveform\+Controller\+Function}!Waveform\+Controller\+Function@{Waveform\+Controller\+Function}}
\index{Waveform\+Controller\+Function@{Waveform\+Controller\+Function}!Ogre\+::\+Waveform\+Controller\+Function@{Ogre\+::\+Waveform\+Controller\+Function}}
\subsubsection{\texorpdfstring{Waveform\+Controller\+Function()}{WaveformControllerFunction()}}
{\footnotesize\ttfamily Ogre\+::\+Waveform\+Controller\+Function\+::\+Waveform\+Controller\+Function (\begin{DoxyParamCaption}\item[{\hyperlink{group___general_gabf2e0412a783a6f708ca1a58abb45c1b}{Waveform\+Type}}]{w\+Type,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{base = {\ttfamily 0},  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{frequency = {\ttfamily 1},  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{phase = {\ttfamily 0},  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{amplitude = {\ttfamily 1},  }\item[{bool}]{delta\+Input = {\ttfamily true},  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{duty\+Cycle = {\ttfamily 0.5} }\end{DoxyParamCaption})}



Default constructor, requires at least a wave type, other parameters can be defaulted unless required. 


\begin{DoxyParams}{Parameters}
{\em w\+Type} & the shape of the wave \\
\hline
{\em base} & the base value of the output from the wave \\
\hline
{\em frequency} & the speed of the wave in cycles per second \\
\hline
{\em phase} & the offset of the start of the wave, e.\+g. 0.\+5 to start half-\/way through the wave \\
\hline
{\em amplitude} & scales the output so that instead of lying within \mbox{[}0,1\mbox{]} it lies within \mbox{[}0,1\mbox{]} $\ast$ amplitude \\
\hline
{\em delta\+Input} & If true, signifies that the input will be a delta value such that the function should add it to an internal counter before calculating the output. \\
\hline
{\em duty\+Cycle} & Used in P\+WM mode to specify the pulse width. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_waveform_controller_function_aec4afc09add54fd7872f78e299e1d276}\label{class_ogre_1_1_waveform_controller_function_aec4afc09add54fd7872f78e299e1d276}} 
\index{Ogre\+::\+Waveform\+Controller\+Function@{Ogre\+::\+Waveform\+Controller\+Function}!calculate@{calculate}}
\index{calculate@{calculate}!Ogre\+::\+Waveform\+Controller\+Function@{Ogre\+::\+Waveform\+Controller\+Function}}
\subsubsection{\texorpdfstring{calculate()}{calculate()}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Waveform\+Controller\+Function\+::calculate (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{source }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Overridden function. 



Implements \hyperlink{class_ogre_1_1_controller_function_a0f77d037a78ce3b430c0a18fbe711df0}{Ogre\+::\+Controller\+Function$<$ Real $>$}.



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