Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgrePredefinedControllers.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 © 2000-2002 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 __PredefinedControllers_H__
00026 #define __PredefinedControllers_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 
00030 #include "OgreController.h"
00031 #include "OgreFrameListener.h"
00032 #include "OgreMaterial.h"
00033 #include "OgreGpuProgram.h"
00034 
00035 namespace Ogre {
00036 
00037     //-----------------------------------------------------------------------
00038     // Controller Values
00039     //-----------------------------------------------------------------------
00042     class _OgreExport FrameTimeControllerValue : public ControllerValue<Real>, public FrameListener
00043     {
00044     protected:
00045         Real mFrameTime;
00046         Real mTimeFactor;
00047 
00048     public:
00049         FrameTimeControllerValue();
00050         bool frameEnded(const FrameEvent &evt);
00051         bool frameStarted(const FrameEvent &evt);
00052         Real getValue(void) const;
00053         void setValue(Real value);
00054         Real getTimeFactor(void) const;
00055         void setTimeFactor(Real tf);
00056     };
00057 
00058     //-----------------------------------------------------------------------
00061     class _OgreExport TextureFrameControllerValue : public ControllerValue<Real>
00062     {
00063     protected:
00064         TextureUnitState* mTextureLayer;
00065     public:
00066         TextureFrameControllerValue(TextureUnitState* t);
00067 
00070         Real getValue(void) const;
00073         void setValue(Real value);
00074 
00075     };
00076     //-----------------------------------------------------------------------
00085     class _OgreExport TexCoordModifierControllerValue : public ControllerValue<Real>
00086     {
00087     protected:
00088         bool mTransU, mTransV;
00089         bool mScaleU, mScaleV;
00090         bool mRotate;
00091         TextureUnitState* mTextureLayer;
00092     public:
00107         TexCoordModifierControllerValue(TextureUnitState* t, bool translateU = false, bool translateV = false,
00108             bool scaleU = false, bool scaleV = false, bool rotate = false );
00109 
00110         Real getValue(void) const;
00111         void setValue(Real value);
00112 
00113     };
00114 
00115     //-----------------------------------------------------------------------
00128     class _OgreExport FloatGpuParameterControllerValue : public ControllerValue<Real>
00129     {
00130     protected:
00132         GpuProgramParametersSharedPtr mParams;
00134         size_t mParamIndex;
00135     public:
00142         FloatGpuParameterControllerValue(GpuProgramParametersSharedPtr params,
00143                 size_t index );
00144 
00145         Real getValue(void) const;
00146         void setValue(Real value);
00147 
00148     };
00149     //-----------------------------------------------------------------------
00150     // Controller functions
00151     //-----------------------------------------------------------------------
00152 
00155     class _OgreExport AnimationControllerFunction : public ControllerFunction<Real>
00156     {
00157     protected:
00158         Real mSeqTime;
00159         Real mTime;
00160     public:
00167         AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f);
00168 
00171         Real calculate(Real source);
00172     };
00173 
00174     //-----------------------------------------------------------------------
00177     class _OgreExport ScaleControllerFunction : public ControllerFunction<Real>
00178     {
00179     protected:
00180         Real mScale;
00181     public:
00189         ScaleControllerFunction(Real scalefactor, bool deltaInput);
00190 
00193         Real calculate(Real source);
00194 
00195     };
00196 
00197     //-----------------------------------------------------------------------
00216     class _OgreExport WaveformControllerFunction : public ControllerFunction<Real>
00217     {
00218     protected:
00219         WaveformType mWaveType;
00220         Real mBase;
00221         Real mFrequency;
00222         Real mPhase;
00223         Real mAmplitude;
00224 
00226         Real getAdjustedInput(Real input);
00227 
00228     public:
00234         WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true);
00235 
00238         Real calculate(Real source);
00239 
00240     };
00241     //-----------------------------------------------------------------------
00242 
00243 }
00244 
00245 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:22 2004