OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreControllerManager.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 __ControllerManager_H__
29 #define __ControllerManager_H__
30 
31 #include "OgrePrerequisites.h"
32 
33 #include "OgreCommon.h"
34 #include "OgreSingleton.h"
35 #include "OgreTextureUnitState.h"
36 #include "OgreSharedPtr.h"
37 #include "OgreHeaderPrefix.h"
38 
39 namespace Ogre {
49 
56  class _OgreExport ControllerManager : public Singleton<ControllerManager>, public ControllerAlloc
57  {
58  protected:
61 
64 
67 
69  unsigned long mLastFrameNumber;
70 
71  public:
74 
77  Controller<Real>* createController(const ControllerValueRealPtr& src,
78  const ControllerValueRealPtr& dest, const ControllerFunctionRealPtr& func);
79 
82  Controller<Real>* createFrameTimePassthroughController(
83  const ControllerValueRealPtr& dest);
84 
87  void clearControllers(void);
88 
91  void updateAllControllers(void);
92 
93 
103  const ControllerValueRealPtr& getFrameTimeSource(void) const;
104 
106  const ControllerFunctionRealPtr& getPassthroughControllerFunction(void) const;
107 
117  Controller<Real>* createTextureAnimator(TextureUnitState* layer, Real sequenceTime);
118 
131  Controller<Real>* createTextureUVScroller(TextureUnitState* layer, Real speed);
132 
143  Controller<Real>* createTextureUScroller(TextureUnitState* layer, Real uSpeed);
144 
155  Controller<Real>* createTextureVScroller(TextureUnitState* layer, Real vSpeed);
156 
167  Controller<Real>* createTextureRotater(TextureUnitState* layer, Real speed);
168 
186  Controller<Real>* createTextureWaveTransformer(TextureUnitState* layer, TextureUnitState::TextureTransformType ttype,
187  WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1);
188 
201  Controller<Real>* createGpuProgramTimerParam(GpuProgramParametersSharedPtr params, size_t paramIndex,
202  Real timeFactor = 1.0f);
203 
206  void destroyController(Controller<Real>* controller);
207 
212  Real getTimeFactor(void) const;
213 
223  void setTimeFactor(Real tf);
224 
229  Real getFrameDelay(void) const;
230 
243  void setFrameDelay(Real fd);
244 
249  Real getElapsedTime(void) const;
250 
259  void setElapsedTime(Real elapsedTime);
260 
276  static ControllerManager& getSingleton(void);
292  static ControllerManager* getSingletonPtr(void);
293  };
294 
298 } // namespace Ogre
299 
300 #include "OgreHeaderSuffix.h"
301 
302 #endif // __ControllerManager_H__
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:255
ControllerFunctionRealPtr mPassthroughFunction
Global predefined controller.
ControllerValueRealPtr mFrameTimeController
Global predefined controller.
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition: OgreCommon.h:192
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
SharedPtr< ControllerValue< Real > > ControllerValueRealPtr
set< Controller< Real > * >::type ControllerList
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
unsigned long mLastFrameNumber
Last frame number updated.
SharedPtr< ControllerFunction< Real > > ControllerFunctionRealPtr
TextureTransformType
Useful enumeration when dealing with procedural transforms.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
Class for managing Controller instances.