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 "OgreCommon.h"
    00031 #include "OgreController.h"
    00032 #include "OgreFrameListener.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         GpuProgramParameters* mParams;
    00134         size_t mParamIndex;
    00135     public:
    00142         FloatGpuParameterControllerValue(GpuProgramParameters* params,
    00143                 size_t index );
    00144
    00145         ~FloatGpuParameterControllerValue() {}
    00146
    00147         Real getValue(void) const;
    00148         void setValue(Real value);
    00149
    00150     };
    00151     //-----------------------------------------------------------------------
    00152     // Controller functions
    00153     //-----------------------------------------------------------------------
    00154
    00157     class _OgreExport AnimationControllerFunction : public ControllerFunction<Real>
    00158     {
    00159     protected:
    00160         Real mSeqTime;
    00161         Real mTime;
    00162     public:
    00169         AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f);
    00170
    00173         Real calculate(Real source);
    00174     };
    00175
    00176     //-----------------------------------------------------------------------
    00179     class _OgreExport ScaleControllerFunction : public ControllerFunction<Real>
    00180     {
    00181     protected:
    00182         Real mScale;
    00183     public:
    00191         ScaleControllerFunction(Real scalefactor, bool deltaInput);
    00192
    00195         Real calculate(Real source);
    00196
    00197     };
    00198
    00199     //-----------------------------------------------------------------------
    00218     class _OgreExport WaveformControllerFunction : public ControllerFunction<Real>
    00219     {
    00220     protected:
    00221         WaveformType mWaveType;
    00222         Real mBase;
    00223         Real mFrequency;
    00224         Real mPhase;
    00225         Real mAmplitude;
    00226
    00228         Real getAdjustedInput(Real input);
    00229
    00230     public:
    00236         WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true);
    00237
    00240         Real calculate(Real source);
    00241
    00242     };
    00243     //-----------------------------------------------------------------------
    00244
    00245 }
    00246
    00247 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:39 2004