00001 00002 /* 00003 ----------------------------------------------------------------------------- 00004 This source file is part of OGRE 00005 (Object-oriented Graphics Rendering Engine) 00006 For the latest info, see http://ogre.sourceforge.net/ 00007 00008 Copyright © 2000-2002 The OGRE Team 00009 Also see acknowledgements in Readme.html 00010 00011 This program is free software; you can redistribute it and/or modify it under 00012 the terms of the GNU Lesser General Public License as published by the Free Software 00013 Foundation; either version 2 of the License, or (at your option) any later 00014 version. 00015 00016 This program is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00018 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00019 00020 You should have received a copy of the GNU Lesser General Public License along with 00021 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00022 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00023 http://www.gnu.org/copyleft/lesser.txt. 00024 ----------------------------------------------------------------------------- 00025 */ 00026 #ifndef __PredefinedControllers_H__ 00027 #define __PredefinedControllers_H__ 00028 00029 #include "OgrePrerequisites.h" 00030 00031 #include "OgreController.h" 00032 #include "OgreFrameListener.h" 00033 #include "OgreMaterial.h" 00034 00035 namespace Ogre { 00036 00037 //----------------------------------------------------------------------- 00038 // Controller Values 00039 //----------------------------------------------------------------------- 00042 class _OgreExport FrameTimeControllerValue : public ControllerValue, 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); 00053 void setValue(Real value); 00054 Real getTimeFactor(void); 00055 void setTimeFactor(Real tf); 00056 }; 00057 00058 //----------------------------------------------------------------------- 00061 class _OgreExport TextureFrameControllerValue : public ControllerValue 00062 { 00063 protected: 00064 Material::TextureLayer* mTextureLayer; 00065 public: 00066 TextureFrameControllerValue(Material::TextureLayer* t); 00067 00070 Real getValue(void); 00073 void setValue(Real value); 00074 00075 }; 00076 //----------------------------------------------------------------------- 00085 class _OgreExport TexCoordModifierControllerValue : public ControllerValue 00086 { 00087 protected: 00088 bool mTransU, mTransV; 00089 bool mScaleU, mScaleV; 00090 bool mRotate; 00091 Material::TextureLayer* mTextureLayer; 00092 public: 00107 TexCoordModifierControllerValue(Material::TextureLayer* t, bool translateU = false, bool translateV = false, 00108 bool scaleU = false, bool scaleV = false, bool rotate = false ); 00109 00110 Real getValue(void); 00111 void setValue(Real value); 00112 00113 }; 00114 00115 //----------------------------------------------------------------------- 00116 // Controller functions 00117 //----------------------------------------------------------------------- 00118 00121 class _OgreExport AnimationControllerFunction : public ControllerFunction 00122 { 00123 protected: 00124 Real mSeqTime; 00125 Real mTime; 00126 public: 00133 AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f); 00134 00137 Real calculate(Real source); 00138 }; 00139 00140 //----------------------------------------------------------------------- 00143 class _OgreExport ScaleControllerFunction : public ControllerFunction 00144 { 00145 protected: 00146 Real mScale; 00147 public: 00155 ScaleControllerFunction(Real scalefactor, bool deltaInput); 00156 00159 Real calculate(Real source); 00160 00161 }; 00162 00163 //----------------------------------------------------------------------- 00182 class _OgreExport WaveformControllerFunction : public ControllerFunction 00183 { 00184 protected: 00185 WaveformType mWaveType; 00186 Real mBase; 00187 Real mFrequency; 00188 Real mPhase; 00189 Real mAmplitude; 00190 00192 Real getAdjustedInput(Real input); 00193 00194 public: 00200 WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true); 00201 00204 Real calculate(Real source); 00205 00206 }; 00207 //----------------------------------------------------------------------- 00208 00209 } 00210 00211 #endif
Copyright © 2002 by The OGRE Team