# OgreControllerManager.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004     (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org/
    00006
    00007 Copyright (c) 2000-2005 The OGRE Team
    00008 Also see acknowledgements in Readme.html
    00009
    00010 This program is free software; you can redistribute it and/or modify it under
    00011 the terms of the GNU Lesser General Public License as published by the Free Software
    00012 Foundation; either version 2 of the License, or (at your option) any later
    00013 version.
    00014
    00015 This program is distributed in the hope that it will be useful, but WITHOUT
    00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00018
    00019 You should have received a copy of the GNU Lesser General Public License along with
    00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00022 http://www.gnu.org/copyleft/lesser.txt.
    00023 -----------------------------------------------------------------------------
    00024 */
    00025 #ifndef __ControllerManager_H__
    00026 #define __ControllerManager_H__
    00027
    00028 #include "OgrePrerequisites.h"
    00029
    00030 #include "OgreCommon.h"
    00031 #include "OgreSingleton.h"
    00032 #include "OgreController.h"
    00033 #include "OgrePredefinedControllers.h"
    00034 #include "OgreTextureUnitState.h"
    00035 #include "OgreSharedPtr.h"
    00036
    00037 namespace Ogre {
    00038
    00039     typedef SharedPtr< ControllerValue<Real> > ControllerValueRealPtr;
    00040     typedef SharedPtr< ControllerFunction<Real> > ControllerFunctionRealPtr;
    00041
    00048     class _OgreExport ControllerManager : public Singleton<ControllerManager>
    00049     {
    00050     protected:
    00051         typedef std::set<Controller<Real>*> ControllerList;
    00052         ControllerList mControllers;
    00053
    00055         SharedPtr< ControllerValue<Real> > mFrameTimeController;
    00056
    00057     public:
    00058         ControllerManager();
    00059         ~ControllerManager();
    00060
    00063         Controller<Real>* createController(const ControllerValueRealPtr& src,
    00064             const ControllerValueRealPtr& dest, const ControllerFunctionRealPtr& func);
    00065
    00068         void clearControllers(void);
    00069
    00072         void updateAllControllers(void);
    00073
    00074
    00084         const ControllerValueRealPtr& getFrameTimeSource(void) const;
    00085
    00095         Controller<Real>* createTextureAnimator(TextureUnitState* layer, Real sequenceTime);
    00096
    00109         Controller<Real>* createTextureScroller(TextureUnitState* layer, Real uSpeed, Real vSpeed);
    00110
    00121         Controller<Real>* createTextureRotater(TextureUnitState* layer, Real speed);
    00122
    00140         Controller<Real>* createTextureWaveTransformer(TextureUnitState* layer, TextureUnitState::TextureTransformType ttype,
    00141             WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1);
    00142
    00152         Controller<Real>* createGpuProgramTimerParam(GpuProgramParameters* params, size_t paramIndex,
    00153             Real timeFactor = 1.0f);
    00154
    00157         void destroyController(Controller<Real>* controller);
    00158
    00163         Real getTimeFactor(void) const;
    00164
    00173         void setTimeFactor(Real tf);
    00174
    00179         Real getElapsedTime(void) const;
    00180
    00188         void setElapsedTime(Real elapsedTime);
    00189
    00205         static ControllerManager& getSingleton(void);
    00221         static ControllerManager* getSingletonPtr(void);
    00222     };
    00223
    00224
    00225 }
    00226 #endif

Copyright © 2000-2005 by The OGRE Team
Last modified Sun Nov 20 12:35:57 2005