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

texmatrixgen.h

Go to the documentation of this file.
00001 /***************************************************************************
00002      texmatrixgen.h  -  Texture coordinate transform matrix generators
00003                              -------------------
00004     begin                : Tue Feb 11 2003
00005     copyright            : (C) 2003 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, texmatrixgen.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2003
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NETEXMATRIXGEN_H
00028 #define __NETEXMATRIXGEN_H
00029 
00030 
00037 #include "base.h"
00038 
00039 #include <string>
00040 
00041 
00042 namespace NeoEngine
00043 {
00044 
00045 
00046 // External classes
00047 class Matrix;
00048 
00049 
00054 class NEOENGINE_API TextureMatrixGen
00055 {
00056     public:
00057 
00061         enum TEXMODFUNCTABLEDEF
00062         {
00064           TEXMODFUNCTABLE_SIZE                   = 1024,
00065 
00067           TEXMODFUNCTABLE_MASK                   = ( TEXMODFUNCTABLE_SIZE - 1 )
00068         };
00069 
00071         static float                             s_afSinTable[ TEXMODFUNCTABLE_SIZE ];
00072 
00074         static float                             s_afSquareTable[ TEXMODFUNCTABLE_SIZE ];
00075 
00077         static float                             s_afTriangleTable[ TEXMODFUNCTABLE_SIZE ];
00078 
00080         static float                             s_afSawToothTable[ TEXMODFUNCTABLE_SIZE ];
00081 
00083         static float                             s_afInverseSawToothTable[ TEXMODFUNCTABLE_SIZE ];
00084 
00085 
00091         virtual void                            GenerateMatrix( Matrix *pkMatrix ) = 0;
00092 
00097         virtual TextureMatrixGen               *Duplicate() = 0;
00098 };
00099 
00100 
00105 class NEOENGINE_API TextureMatrixGenScroll : public TextureMatrixGen
00106 {
00107     public:
00108 
00110         float                                   m_afScrollSpeed[2];
00111 
00112 
00117         virtual void                            GenerateMatrix( Matrix *pkMatrix );
00118 
00123         virtual TextureMatrixGen               *Duplicate();
00124 };
00125 
00126 
00131 class NEOENGINE_API TextureMatrixGenScale : public TextureMatrixGen
00132 {
00133     public:
00134 
00136         float                                   m_afScale[2];
00137 
00138 
00143         virtual void                            GenerateMatrix( Matrix *pkMatrix );
00144 
00149         virtual TextureMatrixGen               *Duplicate();
00150 };
00151 
00152 
00157 class NEOENGINE_API TextureMatrixGenStretch : public TextureMatrixGen
00158 {
00159     public:
00160 
00162         float                                  *m_pfTable;
00163 
00165         float                                   m_fBase;
00166 
00168         float                                   m_fAmplitude;
00169 
00171         float                                   m_fPhase;
00172 
00174         float                                   m_fFrequency;
00175 
00176 
00181         virtual void                            GenerateMatrix( Matrix *pkMatrix );
00182 
00187         virtual TextureMatrixGen               *Duplicate();
00188 };
00189 
00190 
00195 class NEOENGINE_API TextureMatrixGenTurbulence : public TextureMatrixGen
00196 {
00197     public:
00198 
00200         float                                   m_fBase;
00201 
00203         float                                   m_fAmplitude;
00204 
00206         float                                   m_fPhase;
00207 
00209         float                                   m_fFrequency;
00210 
00211 
00216         virtual void                            GenerateMatrix( Matrix *pkMatrix );
00217 
00222         virtual TextureMatrixGen               *Duplicate();
00223 };
00224 
00225 
00230 class NEOENGINE_API TextureMatrixGenTransform : public TextureMatrixGen
00231 {
00232     public:
00233 
00235         float                                   m_aafRotate[2][2];
00236 
00238         float                                   m_afTranslate[2];
00239 
00244         virtual void                            GenerateMatrix( Matrix *pkMatrix );
00245 
00250         virtual TextureMatrixGen               *Duplicate();
00251 };
00252 
00253 
00258 class NEOENGINE_API TextureMatrixGenRotate : public TextureMatrixGen
00259 {
00260     public:
00261 
00263         float                                   m_fRotateSpeed;
00264 
00269         virtual void                            GenerateMatrix( Matrix *pkMatrix );
00270 
00275         virtual TextureMatrixGen               *Duplicate();
00276 };
00277 
00278 
00283 class NEOENGINE_API TextureMatrixGenFactory
00284 {
00285     public:
00286 
00291         static TextureMatrixGen                *CreateTextureMatrixGen( const std::string &rstrName );
00292 };
00293 
00294 
00295 };
00296 
00297 
00298 #endif
00299 
00300 

Generated on Wed Jan 21 14:21:07 2004 for NeoEngine by doxygen 1.3.5