<html> <head> <title>Ogre::WaveformControllerFunction class Reference - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link type="text/css" rel="stylesheet" href="style.css"> </head> <body> <!-- Generated by Doxygen 1.2.16 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>Ogre::WaveformControllerFunction Class Reference</h1>Predefined controller function based on a waveform. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a>></code> <p> Inheritance diagram for Ogre::WaveformControllerFunction:<p><center><img src="classOgre_1_1WaveformControllerFunction__inherit__graph.png" border="0" usemap="#Ogre_1_1WaveformControllerFunction__inherit__map" alt="Inheritance graph"></center> <map name="Ogre_1_1WaveformControllerFunction__inherit__map"> <area href="classOgre_1_1ControllerFunction.html" shape="rect" coords="11,36,216,17" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Ogre::WaveformControllerFunction:<p><center><img src="classOgre_1_1WaveformControllerFunction__coll__graph.png" border="0" usemap="#Ogre_1_1WaveformControllerFunction__coll__map" alt="Collaboration graph"></center> <map name="Ogre_1_1WaveformControllerFunction__coll__map"> <area href="classOgre_1_1ControllerFunction.html" shape="rect" coords="11,36,216,17" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classOgre_1_1WaveformControllerFunction-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctiona0">WaveformControllerFunction</a> (<a class="el" href="namespaceOgre.html#a621">WaveformType</a> wType, <a class="el" href="namespaceOgre.html#a349">Real</a> base=0, <a class="el" href="namespaceOgre.html#a349">Real</a> frequency=1, <a class="el" href="namespaceOgre.html#a349">Real</a> phase=0, <a class="el" href="namespaceOgre.html#a349">Real</a> amplitude=1, bool deltaInput=true)</td></tr> <tr><td> </td><td><font size=-1><em>Default contructor, requires at least a wave type, other parameters can be defaulted unless required.</em> <a href="#Ogre_1_1WaveformControllerFunctiona0"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctiona1">calculate</a> (<a class="el" href="namespaceOgre.html#a349">Real</a> source)</td></tr> <tr><td> </td><td><font size=-1><em>Overriden function.</em> <a href="#Ogre_1_1WaveformControllerFunctiona1"></a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Protected Methods</h2></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctionb0">getAdjustedInput</a> (<a class="el" href="namespaceOgre.html#a349">Real</a> input)</td></tr> <tr><td> </td><td><font size=-1><em>Overridden from <a class="el" href="classOgre_1_1ControllerFunction.html">ControllerFunction</a>.</em> <a href="#Ogre_1_1WaveformControllerFunctionb0"></a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a621">WaveformType</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctionn0">mWaveType</a></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctionn1">mBase</a></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctionn2">mFrequency</a></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctionn3">mPhase</a></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1WaveformControllerFunctionn4">mAmplitude</a></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1ControllerFunctionn0">mDeltaInput</a></td></tr> <tr><td> </td><td><font size=-1><em>If true, function will add imput values together and wrap at 1.0 before evaluating.</em> <a href="#Ogre_1_1ControllerFunctionn0"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1WaveformControllerFunction.html#Ogre_1_1ControllerFunctionn1">mDeltaCount</a></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Predefined controller function based on a waveform. <p> <dl compact><dt><b> Remarks: </b><dd> A waveform function translates parametric intput to parametric output based on a wave. The factors affecting the function are:<ul> <li>wave type - the shape of the wave<li>base - the base value of the output from the wave<li>frequency - the speed of the wave in cycles per second<li>phase - the offset of the start of the wave, e.g. 0.5 to start half-way through the wave<li>amplitude - scales the output so that instead of lying within [0,1] it lies within [0,1] * amplitude </ul> </dl> <p> 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 [-1,1]. To compensate for this, the traditional output of the wave is scaled by the following function before output: <p> output = (waveoutput + 1) * 0.5 <p> Hence a wave output of -1 becomes 0, a wave ouput of 1 becomes 1, and a wave output of 0 becomes 0.5. <p> <p> Definition at line <a class="el" href="OgrePredefinedControllers_8h-source.html#l00216">216</a> of file <a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a name="Ogre_1_1WaveformControllerFunctiona0" doxytag="Ogre::WaveformControllerFunction::WaveformControllerFunction"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Ogre::WaveformControllerFunction::WaveformControllerFunction </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="namespaceOgre.html#a621">WaveformType</a> </td> <td class="mdname" nowrap> <em>wType</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname" nowrap> <em>base</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname" nowrap> <em>frequency</em> = 1, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname" nowrap> <em>phase</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname" nowrap> <em>amplitude</em> = 1, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>deltaInput</em> = true</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Default contructor, requires at least a wave type, other parameters can be defaulted unless required. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>deltaInput</em> </td><td> 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. </td></tr> </table> </dl> <p> Definition at line <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00229">229</a> of file <a class="el" href="OgrePredefinedControllers_8cpp-source.html">OgrePredefinedControllers.cpp</a>. <p> References <a class="el" href="OgrePredefinedControllers_8h-source.html#l00223">mAmplitude</a>, <a class="el" href="OgrePredefinedControllers_8h-source.html#l00220">mBase</a>, <a class="el" href="OgreController_8h-source.html#l00052">Ogre::ControllerFunction< Real >::mDeltaCount</a>, <a class="el" href="OgrePredefinedControllers_8h-source.html#l00221">mFrequency</a>, <a class="el" href="OgrePredefinedControllers_8h-source.html#l00222">mPhase</a>, <a class="el" href="OgrePredefinedControllers_8h-source.html#l00219">mWaveType</a>, <a class="el" href="OgrePrerequisites_8h-source.html#l00086">Ogre::Real</a>, and <a class="el" href="OgreCommon_8h-source.html#l00144">Ogre::WaveformType</a>. </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="Ogre_1_1WaveformControllerFunctiona1" doxytag="Ogre::WaveformControllerFunction::calculate"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::WaveformControllerFunction::calculate </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname1" valign="top" nowrap> <em>source</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Overriden function. <p> <p> Implements <a class="el" href="classOgre_1_1ControllerFunction.html#Ogre_1_1ControllerFunctiona1">Ogre::ControllerFunction< Real ></a>. <p> Definition at line <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00255">255</a> of file <a class="el" href="OgrePredefinedControllers_8cpp-source.html">OgrePredefinedControllers.cpp</a>. <p> References <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00241">getAdjustedInput</a>(), <a class="el" href="OgrePredefinedControllers_8h-source.html#l00223">mAmplitude</a>, <a class="el" href="OgrePredefinedControllers_8h-source.html#l00220">mBase</a>, <a class="el" href="OgrePredefinedControllers_8h-source.html#l00221">mFrequency</a>, <a class="el" href="OgrePrerequisites_8h-source.html#l00086">Ogre::Real</a>, <a class="el" href="namespaceOgre.html#a621a96">Ogre::WFT_INVERSE_SAWTOOTH</a>, <a class="el" href="namespaceOgre.html#a621a95">Ogre::WFT_SAWTOOTH</a>, <a class="el" href="namespaceOgre.html#a621a92">Ogre::WFT_SINE</a>, <a class="el" href="namespaceOgre.html#a621a94">Ogre::WFT_SQUARE</a>, and <a class="el" href="namespaceOgre.html#a621a93">Ogre::WFT_TRIANGLE</a>. </td> </tr> </table> <a name="Ogre_1_1WaveformControllerFunctionb0" doxytag="Ogre::WaveformControllerFunction::getAdjustedInput"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::WaveformControllerFunction::getAdjustedInput </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname1" valign="top" nowrap> <em>input</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [protected]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Overridden from <a class="el" href="classOgre_1_1ControllerFunction.html">ControllerFunction</a>. <p> <p> Reimplemented from <a class="el" href="classOgre_1_1ControllerFunction.html#Ogre_1_1ControllerFunctionb0">Ogre::ControllerFunction< Real ></a>. <p> Definition at line <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00241">241</a> of file <a class="el" href="OgrePredefinedControllers_8cpp-source.html">OgrePredefinedControllers.cpp</a>. <p> References <a class="el" href="OgreController_8h-source.html#l00051">Ogre::ControllerFunction< Real >::mDeltaInput</a>, <a class="el" href="OgrePredefinedControllers_8h-source.html#l00222">mPhase</a>, and <a class="el" href="OgrePrerequisites_8h-source.html#l00086">Ogre::Real</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00255">calculate</a>(). </td> </tr> </table> <hr><h2>Member Data Documentation</h2> <a name="Ogre_1_1WaveformControllerFunctionn4" doxytag="Ogre::WaveformControllerFunction::mAmplitude"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::WaveformControllerFunction::mAmplitude<code> [protected]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgrePredefinedControllers_8h-source.html#l00223">223</a> of file <a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00255">calculate</a>(), and <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00229">WaveformControllerFunction</a>(). </td> </tr> </table> <a name="Ogre_1_1WaveformControllerFunctionn1" doxytag="Ogre::WaveformControllerFunction::mBase"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::WaveformControllerFunction::mBase<code> [protected]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgrePredefinedControllers_8h-source.html#l00220">220</a> of file <a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00255">calculate</a>(), and <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00229">WaveformControllerFunction</a>(). </td> </tr> </table> <a name="Ogre_1_1ControllerFunctionn1" doxytag="Ogre::WaveformControllerFunction::mDeltaCount"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> <a class="el" href="classOgre_1_1ControllerFunction.html">Ogre::ControllerFunction</a>< <a class="el" href="namespaceOgre.html#a349">Real</a> >::mDeltaCount<code> [protected, inherited]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgreController_8h-source.html#l00052">52</a> of file <a class="el" href="OgreController_8h-source.html">OgreController.h</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00229">WaveformControllerFunction</a>(). </td> </tr> </table> <a name="Ogre_1_1ControllerFunctionn0" doxytag="Ogre::WaveformControllerFunction::mDeltaInput"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool <a class="el" href="classOgre_1_1ControllerFunction.html">Ogre::ControllerFunction</a>< <a class="el" href="namespaceOgre.html#a349">Real</a> >::mDeltaInput<code> [protected, inherited]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> If true, function will add imput values together and wrap at 1.0 before evaluating. <p> <p> Definition at line <a class="el" href="OgreController_8h-source.html#l00051">51</a> of file <a class="el" href="OgreController_8h-source.html">OgreController.h</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00241">getAdjustedInput</a>(). </td> </tr> </table> <a name="Ogre_1_1WaveformControllerFunctionn2" doxytag="Ogre::WaveformControllerFunction::mFrequency"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::WaveformControllerFunction::mFrequency<code> [protected]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgrePredefinedControllers_8h-source.html#l00221">221</a> of file <a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00255">calculate</a>(), and <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00229">WaveformControllerFunction</a>(). </td> </tr> </table> <a name="Ogre_1_1WaveformControllerFunctionn3" doxytag="Ogre::WaveformControllerFunction::mPhase"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::WaveformControllerFunction::mPhase<code> [protected]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgrePredefinedControllers_8h-source.html#l00222">222</a> of file <a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00241">getAdjustedInput</a>(), and <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00229">WaveformControllerFunction</a>(). </td> </tr> </table> <a name="Ogre_1_1WaveformControllerFunctionn0" doxytag="Ogre::WaveformControllerFunction::mWaveType"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a621">WaveformType</a> Ogre::WaveformControllerFunction::mWaveType<code> [protected]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgrePredefinedControllers_8h-source.html#l00219">219</a> of file <a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a>. <p> Referenced by <a class="el" href="OgrePredefinedControllers_8cpp-source.html#l00229">WaveformControllerFunction</a>(). </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="OgrePredefinedControllers_8h-source.html">OgrePredefinedControllers.h</a><li><a class="el" href="OgrePredefinedControllers_8cpp-source.html">OgrePredefinedControllers.cpp</a></ul> <p> Copyright © 2002-2003 by The OGRE Team<br /> Last modified Wed Jan 21 00:21:19 2004 </p> </body> </html>