OgreControllerManager.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __ControllerManager_H__
#define __ControllerManager_H__
#include "OgrePrerequisites.h"
#include "OgreCommon.h"
#include "OgreSingleton.h"
#include "OgreController.h"
#include "OgrePredefinedControllers.h"
#include "OgreTextureUnitState.h"
#include "OgreSharedPtr.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
typedef SharedPtr< ControllerValue<Real> > ControllerValueRealPtr;
typedef SharedPtr< ControllerFunction<Real> > ControllerFunctionRealPtr;
class _OgreExport ControllerManager : public Singleton<ControllerManager>, public ControllerAlloc
{
protected:
typedef set<Controller<Real>*>::type ControllerList;
ControllerList mControllers;
ControllerValueRealPtr mFrameTimeController;
ControllerFunctionRealPtr mPassthroughFunction;
unsigned long mLastFrameNumber;
public:
ControllerManager();
~ControllerManager();
Controller<Real>* createController(const ControllerValueRealPtr& src,
const ControllerValueRealPtr& dest, const ControllerFunctionRealPtr& func);
Controller<Real>* createFrameTimePassthroughController(
const ControllerValueRealPtr& dest);
void clearControllers(void);
void updateAllControllers(void);
const ControllerValueRealPtr& getFrameTimeSource(void) const;
const ControllerFunctionRealPtr& getPassthroughControllerFunction(void) const;
Controller<Real>* createTextureAnimator(TextureUnitState* layer, Real sequenceTime);
Controller<Real>* createTextureUVScroller(TextureUnitState* layer, Real speed);
Controller<Real>* createTextureUScroller(TextureUnitState* layer, Real uSpeed);
Controller<Real>* createTextureVScroller(TextureUnitState* layer, Real vSpeed);
Controller<Real>* createTextureRotater(TextureUnitState* layer, Real speed);
Controller<Real>* createTextureWaveTransformer(TextureUnitState* layer, TextureUnitState::TextureTransformType ttype,
WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1);
Controller<Real>* createGpuProgramTimerParam(GpuProgramParametersSharedPtr params, size_t paramIndex,
Real timeFactor = 1.0f);
void destroyController(Controller<Real>* controller);
Real getTimeFactor(void) const;
void setTimeFactor(Real tf);
Real getFrameDelay(void) const;
void setFrameDelay(Real fd);
Real getElapsedTime(void) const;
void setElapsedTime(Real elapsedTime);
static ControllerManager& getSingleton(void);
static ControllerManager* getSingletonPtr(void);
};
} // namespace Ogre
#include "OgreHeaderSuffix.h"
#endif // __ControllerManager_H__
Ogre::ControllerManager::mControllers
ControllerList mControllers
Definition: OgreControllerManager.h:62
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::ControllerManager::mFrameTimeController
ControllerValueRealPtr mFrameTimeController
Global predefined controller.
Definition: OgreControllerManager.h:65
Ogre::WaveformType
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition: OgreCommon.h:161
OgreSharedPtr.h
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
OgreTextureUnitState.h
Ogre::ControllerFunctionRealPtr
SharedPtr< ControllerFunction< Real > > ControllerFunctionRealPtr
Definition: OgreControllerManager.h:50
Ogre::ControllerManager::mPassthroughFunction
ControllerFunctionRealPtr mPassthroughFunction
Global predefined controller.
Definition: OgreControllerManager.h:68
Ogre::ControllerManager::mLastFrameNumber
unsigned long mLastFrameNumber
Last frame number updated.
Definition: OgreControllerManager.h:71
OgreController.h
OgrePredefinedControllers.h
OgreCommon.h
Ogre::Controller< Real >
OgreSingleton.h
Ogre::TextureUnitState
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
Definition: OgreTextureUnitState.h:62
OgrePrerequisites.h
Ogre::ControllerManager
Class for managing Controller instances.
Definition: OgreControllerManager.h:58
Ogre::set
Definition: OgrePrerequisites.h:519
OgreHeaderSuffix.h
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::TextureUnitState::TextureTransformType
TextureTransformType
Useful enumeration when dealing with procedural transforms.
Definition: OgreTextureUnitState.h:112
Ogre::SharedPtr
Reference-counted shared pointer, used for objects where implicit destruction is required.
Definition: OgrePrerequisites.h:310
OgreHeaderPrefix.h
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Ogre::ControllerValueRealPtr
SharedPtr< ControllerValue< Real > > ControllerValueRealPtr
Definition: OgreControllerManager.h:49
Ogre::ControllerManager::ControllerList
set< Controller< Real > * >::type ControllerList
Definition: OgreControllerManager.h:61
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58

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