OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgrePredefinedControllers.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __PredefinedControllers_H__
29 #define __PredefinedControllers_H__
30 
31 #include "OgrePrerequisites.h"
32 
33 #include "OgreCommon.h"
34 #include "OgreController.h"
35 #include "OgreFrameListener.h"
36 #include "OgreHeaderPrefix.h"
37 
38 namespace Ogre {
39 
46  //-----------------------------------------------------------------------
47  // Controller Values
48  //-----------------------------------------------------------------------
52  {
53  protected:
58 
59  public:
61  bool frameEnded(const FrameEvent &evt);
62  bool frameStarted(const FrameEvent &evt);
63  Real getValue(void) const;
64  void setValue(Real value);
65  Real getTimeFactor(void) const;
66  void setTimeFactor(Real tf);
67  Real getFrameDelay(void) const;
68  void setFrameDelay(Real fd);
69  Real getElapsedTime(void) const;
70  void setElapsedTime(Real elapsedTime);
71  };
72 
73  //-----------------------------------------------------------------------
77  {
78  protected:
80  public:
82 
85  Real getValue(void) const;
88  void setValue(Real value);
89 
90  };
91  //-----------------------------------------------------------------------
101  {
102  protected:
103  bool mTransU, mTransV;
104  bool mScaleU, mScaleV;
105  bool mRotate;
107  public:
122  TexCoordModifierControllerValue(TextureUnitState* t, bool translateU = false, bool translateV = false,
123  bool scaleU = false, bool scaleV = false, bool rotate = false );
124 
125  Real getValue(void) const;
126  void setValue(Real value);
127 
128  };
129 
130  //-----------------------------------------------------------------------
144  {
145  protected:
149  size_t mParamIndex;
150  public:
158  size_t index );
159 
161 
162  Real getValue(void) const;
163  void setValue(Real value);
164 
165  };
166  //-----------------------------------------------------------------------
167  // Controller functions
168  //-----------------------------------------------------------------------
169 
174  {
175  public:
181  PassthroughControllerFunction(bool deltaInput = false);
182 
185  Real calculate(Real source);
186  };
187 
191  {
192  protected:
195  public:
202  AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f);
203 
206  Real calculate(Real source);
207 
209  void setTime(Real timeVal);
211  void setSequenceTime(Real seqVal);
212  };
213 
214  //-----------------------------------------------------------------------
218  {
219  protected:
221  public:
229  ScaleControllerFunction(Real scalefactor, bool deltaInput);
230 
233  Real calculate(Real source);
234 
235  };
236 
237  //-----------------------------------------------------------------------
258  {
259  protected:
266 
268  Real getAdjustedInput(Real input);
269 
270  public:
278  WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true, Real dutyCycle = 0.5);
279 
282  Real calculate(Real source);
283 
284  };
285  //-----------------------------------------------------------------------
289 }
290 
291 #include "OgreHeaderSuffix.h"
292 
293 #endif
Predefined controller function which just passes through the original source directly to dest...
float Real
Software floating point type.
Predefined controller value for getting the latest frame time.
#define _OgreExport
Definition: OgrePlatform.h:255
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition: OgreCommon.h:192
GpuProgramParametersSharedPtr mParams
The parameters to access.
size_t mParamIndex
The index of the parameter to be read or set.
Predefined controller function based on a waveform.
Predefined controller value for getting / setting a texture coordinate modifications (scales and tran...
Predefined controller value for getting / setting the frame number of a texture layer.
Can either be used as an input or output value.
A interface class defining a listener which can be used to receive notifications of frame events...
Predefined controller function for dealing with animation.
Subclasses of this class are responsible for performing a function on an input value for a Controller...
Predefined controller value for setting a single floating- point value in a constant parameter of a v...
Struct containing information about a frame event.
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
Predefined controller function which simply scales an input to an output value.