OgreControllerManager.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2013 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE 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 "OgreController.h"
38#include "OgreSharedPtr.h"
39#include "OgreHeaderPrefix.h"
40
41namespace Ogre {
51
58 class _OgreExport ControllerManager : public Singleton<ControllerManager>, public ControllerAlloc
59 {
60 protected:
63
66
69
71 unsigned long mLastFrameNumber;
72
73 public:
76
81
86
89 void clearControllers(void);
90
94
95
106
109
120
134
146
158
170
189 WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1);
190
204 Real timeFactor = 1.0f);
205
209
214 Real getTimeFactor(void) const;
215
226
231 Real getFrameDelay(void) const;
232
246
251 Real getElapsedTime(void) const;
252
262
295 };
296
300} // namespace Ogre
301
302#include "OgreHeaderSuffix.h"
303
304#endif // __ControllerManager_H__
#define _OgreExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Class for managing Controller instances.
set< Controller< Real > * >::type ControllerList
const ControllerFunctionRealPtr & getPassthroughControllerFunction(void) const
Retrieve a simple passthrough controller function.
Controller< Real > * createTextureUVScroller(TextureUnitState *layer, Real speed)
Creates a basic time-based texture uv coordinate modifier designed for creating scrolling textures.
const ControllerValueRealPtr & getFrameTimeSource(void) const
Returns a ControllerValue which provides the time since the last frame as a control value source.
ControllerValueRealPtr mFrameTimeController
Global predefined controller.
unsigned long mLastFrameNumber
Last frame number updated.
Controller< Real > * createController(const ControllerValueRealPtr &src, const ControllerValueRealPtr &dest, const ControllerFunctionRealPtr &func)
Creates a new controller and registers it with the manager.
Controller< Real > * createGpuProgramTimerParam(GpuProgramParametersSharedPtr params, size_t paramIndex, Real timeFactor=1.0f)
Creates a controller for passing a frame time value through to a vertex / fragment program parameter.
Controller< Real > * createTextureRotater(TextureUnitState *layer, Real speed)
Creates a basic time-based texture coordinate modifier designed for creating rotating textures.
Controller< Real > * createTextureVScroller(TextureUnitState *layer, Real vSpeed)
Creates a basic time-based texture v coordinate modifier designed for creating scrolling textures.
Real getFrameDelay(void) const
Gets the constant that is added to time lapsed between each frame.
Controller< Real > * createFrameTimePassthroughController(const ControllerValueRealPtr &dest)
Creates a new controller use frame time source and passthrough controller function.
Real getElapsedTime(void) const
Return the elapsed time.
void destroyController(Controller< Real > *controller)
Removes & destroys the controller passed in as a pointer.
Controller< Real > * createTextureUScroller(TextureUnitState *layer, Real uSpeed)
Creates a basic time-based texture u coordinate modifier designed for creating scrolling textures.
void setFrameDelay(Real fd)
Sets a constant frame rate.
static ControllerManager & getSingleton(void)
Override standard Singleton retrieval.
void setTimeFactor(Real tf)
Set the relative speed to update frame time based controllers.
Controller< Real > * createTextureWaveTransformer(TextureUnitState *layer, TextureUnitState::TextureTransformType ttype, WaveformType waveType, Real base=0, Real frequency=1, Real phase=0, Real amplitude=1)
Creates a very flexible time-based texture transformation which can alter the scale,...
void updateAllControllers(void)
Updates all the registered controllers.
static ControllerManager * getSingletonPtr(void)
Override standard Singleton retrieval.
ControllerFunctionRealPtr mPassthroughFunction
Global predefined controller.
Controller< Real > * createTextureAnimator(TextureUnitState *layer, Real sequenceTime)
Creates a texture layer animator controller.
void setElapsedTime(Real elapsedTime)
Set the elapsed time.
void clearControllers(void)
Destroys all the controllers in existence.
Real getTimeFactor(void) const
Return relative speed of time as perceived by time based controllers.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Template class for creating single-instance global classes.
Class representing the state of a single texture unit during a Pass of a Technique,...
TextureTransformType
Useful enumeration when dealing with procedural transforms.
SharedPtr< ControllerValue< Real > > ControllerValueRealPtr
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition OgreCommon.h:162
SharedPtr< ControllerFunction< Real > > ControllerFunctionRealPtr

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