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-2013 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 "OgreGpuProgram.h"
37 #include "OgreHeaderPrefix.h"
38 
39 namespace Ogre {
40 
47  //-----------------------------------------------------------------------
48  // Controller Values
49  //-----------------------------------------------------------------------
53  {
54  protected:
59 
60  public:
62  bool frameEnded(const FrameEvent &evt);
63  bool frameStarted(const FrameEvent &evt);
64  Real getValue(void) const;
65  void setValue(Real value);
66  Real getTimeFactor(void) const;
67  void setTimeFactor(Real tf);
68  Real getFrameDelay(void) const;
69  void setFrameDelay(Real fd);
70  Real getElapsedTime(void) const;
71  void setElapsedTime(Real elapsedTime);
72  };
73 
74  //-----------------------------------------------------------------------
78  {
79  protected:
81  public:
83 
86  Real getValue(void) const;
89  void setValue(Real value);
90 
91  };
92  //-----------------------------------------------------------------------
102  {
103  protected:
104  bool mTransU, mTransV;
105  bool mScaleU, mScaleV;
106  bool mRotate;
108  public:
123  TexCoordModifierControllerValue(TextureUnitState* t, bool translateU = false, bool translateV = false,
124  bool scaleU = false, bool scaleV = false, bool rotate = false );
125 
126  Real getValue(void) const;
127  void setValue(Real value);
128 
129  };
130 
131  //-----------------------------------------------------------------------
145  {
146  protected:
150  size_t mParamIndex;
151  public:
159  size_t index );
160 
162 
163  Real getValue(void) const;
164  void setValue(Real value);
165 
166  };
167  //-----------------------------------------------------------------------
168  // Controller functions
169  //-----------------------------------------------------------------------
170 
175  {
176  public:
182  PassthroughControllerFunction(bool deltaInput = false);
183 
186  Real calculate(Real source);
187  };
188 
192  {
193  protected:
196  public:
203  AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f);
204 
207  Real calculate(Real source);
208 
210  void setTime(Real timeVal);
212  void setSequenceTime(Real seqVal);
213  };
214 
215  //-----------------------------------------------------------------------
219  {
220  protected:
222  public:
230  ScaleControllerFunction(Real scalefactor, bool deltaInput);
231 
234  Real calculate(Real source);
235 
236  };
237 
238  //-----------------------------------------------------------------------
259  {
260  protected:
267 
270 
271  public:
279  WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true, Real dutyCycle = 0.5);
280 
283  Real calculate(Real source);
284 
285  };
286  //-----------------------------------------------------------------------
290 }
291 
292 #include "OgreHeaderSuffix.h"
293 
294 #endif
OgreHeaderSuffix.h
Ogre::WaveformControllerFunction::mDutyCycle
Real mDutyCycle
Definition: OgrePredefinedControllers.h:266
Ogre::FrameListener
A interface class defining a listener which can be used to receive notifications of frame events.
Definition: OgreFrameListener.h:80
Ogre::FrameTimeControllerValue::frameEnded
bool frameEnded(const FrameEvent &evt)
Called just after a frame has been rendered.
Ogre::TexCoordModifierControllerValue::mRotate
bool mRotate
Definition: OgrePredefinedControllers.h:106
Ogre::ControllerValue
Can either be used as an input or output value.
Definition: OgreController.h:105
Ogre::FloatGpuParameterControllerValue::mParamIndex
size_t mParamIndex
The index of the parameter to be read or set.
Definition: OgrePredefinedControllers.h:150
Ogre::TextureUnitState
Class representing the state of a single texture unit during a Pass of a Technique,...
Definition: OgreTextureUnitState.h:63
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::AnimationControllerFunction
Predefined controller function for dealing with animation.
Definition: OgrePredefinedControllers.h:192
Ogre::PassthroughControllerFunction::calculate
Real calculate(Real source)
Overridden function.
Ogre::FrameTimeControllerValue::getTimeFactor
Real getTimeFactor(void) const
Ogre::WaveformControllerFunction::mAmplitude
Real mAmplitude
Definition: OgrePredefinedControllers.h:265
Ogre::FloatGpuParameterControllerValue
Predefined controller value for setting a single floating- point value in a constant parameter of a v...
Definition: OgrePredefinedControllers.h:145
Ogre::AnimationControllerFunction::AnimationControllerFunction
AnimationControllerFunction(Real sequenceTime, Real timeOffset=0.0f)
Constructor.
Ogre::TexCoordModifierControllerValue::mScaleV
bool mScaleV
Definition: OgrePredefinedControllers.h:105
Ogre::TexCoordModifierControllerValue
Predefined controller value for getting / setting a texture coordinate modifications (scales and tran...
Definition: OgrePredefinedControllers.h:102
Ogre::FrameTimeControllerValue
Predefined controller value for getting the latest frame time.
Definition: OgrePredefinedControllers.h:53
Ogre::AnimationControllerFunction::calculate
Real calculate(Real source)
Overridden function.
Ogre::TexCoordModifierControllerValue::mTransV
bool mTransV
Definition: OgrePredefinedControllers.h:104
Ogre::WaveformControllerFunction::mFrequency
Real mFrequency
Definition: OgrePredefinedControllers.h:263
Ogre::TextureFrameControllerValue
Predefined controller value for getting / setting the frame number of a texture layer.
Definition: OgrePredefinedControllers.h:78
Ogre::FrameTimeControllerValue::getFrameDelay
Real getFrameDelay(void) const
Ogre::AnimationControllerFunction::mTime
Real mTime
Definition: OgrePredefinedControllers.h:195
Ogre::WaveformType
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition: OgreCommon.h:162
Ogre::TextureFrameControllerValue::setValue
void setValue(Real value)
Sets the frame number as a parametric value in the range [0,1]; the actual frame number is (value * n...
Ogre::WaveformControllerFunction::calculate
Real calculate(Real source)
Overridden function.
Ogre::TextureFrameControllerValue::getValue
Real getValue(void) const
Gets the frame number as a parametric value in the range [0,1].
Ogre::PassthroughControllerFunction
Predefined controller function which just passes through the original source directly to dest.
Definition: OgrePredefinedControllers.h:175
Ogre::FrameTimeControllerValue::FrameTimeControllerValue
FrameTimeControllerValue()
Ogre::AnimationControllerFunction::setTime
void setTime(Real timeVal)
Set the time value manually.
Ogre::FloatGpuParameterControllerValue::FloatGpuParameterControllerValue
FloatGpuParameterControllerValue(GpuProgramParametersSharedPtr params, size_t index)
Constructor.
Ogre::TexCoordModifierControllerValue::mTextureLayer
TextureUnitState * mTextureLayer
Definition: OgrePredefinedControllers.h:107
Ogre::TexCoordModifierControllerValue::setValue
void setValue(Real value)
Ogre::PassthroughControllerFunction::PassthroughControllerFunction
PassthroughControllerFunction(bool deltaInput=false)
Constructor.
Ogre::WaveformControllerFunction
Predefined controller function based on a waveform.
Definition: OgrePredefinedControllers.h:259
OgreHeaderPrefix.h
Ogre::WaveformControllerFunction::getAdjustedInput
Real getAdjustedInput(Real input)
Overridden from ControllerFunction.
Ogre::WaveformControllerFunction::WaveformControllerFunction
WaveformControllerFunction(WaveformType wType, Real base=0, Real frequency=1, Real phase=0, Real amplitude=1, bool deltaInput=true, Real dutyCycle=0.5)
Default constructor, requires at least a wave type, other parameters can be defaulted unless required...
OgreFrameListener.h
Ogre::FloatGpuParameterControllerValue::getValue
Real getValue(void) const
OgrePrerequisites.h
Ogre::WaveformControllerFunction::mWaveType
WaveformType mWaveType
Definition: OgrePredefinedControllers.h:261
Ogre::TexCoordModifierControllerValue::getValue
Real getValue(void) const
Ogre::ScaleControllerFunction::ScaleControllerFunction
ScaleControllerFunction(Real scalefactor, bool deltaInput)
Constructor, requires a scale factor.
Ogre::FrameTimeControllerValue::setValue
void setValue(Real value)
Ogre::FrameTimeControllerValue::mElapsedTime
Real mElapsedTime
Definition: OgrePredefinedControllers.h:57
OgreController.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
OgreCommon.h
Ogre::FrameTimeControllerValue::getElapsedTime
Real getElapsedTime(void) const
Ogre::ScaleControllerFunction
Predefined controller function which simply scales an input to an output value.
Definition: OgrePredefinedControllers.h:219
Ogre::TextureFrameControllerValue::TextureFrameControllerValue
TextureFrameControllerValue(TextureUnitState *t)
Ogre::WaveformControllerFunction::mBase
Real mBase
Definition: OgrePredefinedControllers.h:262
Ogre::FrameEvent
Struct containing information about a frame event.
Definition: OgreFrameListener.h:45
Ogre::FrameTimeControllerValue::frameStarted
bool frameStarted(const FrameEvent &evt)
Called when a frame is about to begin rendering.
Ogre::FrameTimeControllerValue::mFrameDelay
Real mFrameDelay
Definition: OgrePredefinedControllers.h:58
Ogre::SharedPtr< GpuProgramParameters >
Ogre::ControllerFunction
Subclasses of this class are responsible for performing a function on an input value for a Controller...
Definition: OgreController.h:56
Ogre::FrameTimeControllerValue::setFrameDelay
void setFrameDelay(Real fd)
Ogre::TextureFrameControllerValue::mTextureLayer
TextureUnitState * mTextureLayer
Definition: OgrePredefinedControllers.h:80
OgreGpuProgram.h
Ogre::FloatGpuParameterControllerValue::mParams
GpuProgramParametersSharedPtr mParams
The parameters to access.
Definition: OgrePredefinedControllers.h:148
Ogre::ScaleControllerFunction::mScale
Real mScale
Definition: OgrePredefinedControllers.h:221
Ogre::AnimationControllerFunction::setSequenceTime
void setSequenceTime(Real seqVal)
Set the sequence duration value manually.
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::FrameTimeControllerValue::getValue
Real getValue(void) const
Ogre::AnimationControllerFunction::mSeqTime
Real mSeqTime
Definition: OgrePredefinedControllers.h:194
Ogre::FrameTimeControllerValue::mTimeFactor
Real mTimeFactor
Definition: OgrePredefinedControllers.h:56
Ogre::ScaleControllerFunction::calculate
Real calculate(Real source)
Overridden method.
Ogre::FrameTimeControllerValue::setElapsedTime
void setElapsedTime(Real elapsedTime)
Ogre::WaveformControllerFunction::mPhase
Real mPhase
Definition: OgrePredefinedControllers.h:264
Ogre::TexCoordModifierControllerValue::TexCoordModifierControllerValue
TexCoordModifierControllerValue(TextureUnitState *t, bool translateU=false, bool translateV=false, bool scaleU=false, bool scaleV=false, bool rotate=false)
Constructor.
Ogre::FloatGpuParameterControllerValue::~FloatGpuParameterControllerValue
~FloatGpuParameterControllerValue()
Definition: OgrePredefinedControllers.h:161
Ogre::FrameTimeControllerValue::mFrameTime
Real mFrameTime
Definition: OgrePredefinedControllers.h:55
Ogre::FloatGpuParameterControllerValue::setValue
void setValue(Real value)
Ogre::FrameTimeControllerValue::setTimeFactor
void setTimeFactor(Real tf)

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.