![[]](/images/special/trans.gif)
LibN2L-4 Library Code ReferenceClassesCompounds Files Members Method Index Full Reference cRSkyBox.hGo to the documentation of this file.00001 /************************************************************************ 00002 Nova-2 Library (libN2L, or simply n2l) Game development C++ Library 00003 Copyright (C) 2002 Aaron Cameron 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 A copy of the GNU Lesser General Public License has been provided with 00020 this library in the file 'COPYING'. 00021 00022 Contact information for the author of this library has been provided 00023 with this library in the file 'AUTHOR'. 00024 ************************************************************************/ 00025 #ifndef _n2l4_cRSkyBox_H 00026 #define _n2l4_cRSkyBox_H 00027 00028 #include "n2l/n2l.h" 00029 #include "n2l/geometry.h" 00030 00031 #include "renderObjects/rObjectTypes.h" 00032 00033 #include <vector> 00034 #include <map> 00035 00036 namespace n2l 00037 { 00038 class cGLTexture; 00039 class cVfsNodeInterface; 00040 class cDynVar; 00041 class cRFrustum; 00042 00043 class cRSkyBox 00044 { 00045 public: 00046 typedef enum { 00047 Face_Front = 0, 00048 Face_Back, 00049 Face_Up, 00050 Face_Down, 00051 Face_Left, 00052 Face_Right, 00053 00054 Face_NumFaces 00055 } tFace; 00056 00057 cRSkyBox(); 00058 00059 cRSkyBox( const cVfsNodeInterface & iNode ); 00060 cRSkyBox( const cDynVar & iDef ); 00061 00062 ~cRSkyBox(); 00063 00064 void load( const cDynVar &iDef ); 00065 void load( const cVfsNodeInterface &iNode ); 00066 00067 void boxSize( const tFloat &iSize ); 00068 void subFaceRep( const tFloat &iRep ); 00069 00070 void stepBuildFrom( const tUbyte iDivisions, 00071 const std::vector<cAutoPtr<const cGLTexture> > &iTextures ); 00072 00073 void randomBuildFrom( const tUbyte iDivisions, 00074 const std::vector<cAutoPtr<const cGLTexture> > &iTextures ); 00075 00076 void draw( const tUint iOptions = R_Normal ) const; 00077 00083 void draw( const cRFrustum &iFrustum, 00084 const tVector3f &iPosAdjust, 00085 const tUint iOptions = R_Normal ) const; 00086 00087 00088 void clear(); 00089 00090 private: 00091 00092 typedef std::map<tUint, std::vector<tUint> > tTexDivMap; 00093 00094 std::vector<cAutoPtr<const cGLTexture> > mTextures; 00095 00099 tTexDivMap mFaces[ Face_NumFaces ]; 00100 00103 tSshort mDivisions; 00104 00107 tFloat mBoxSize; 00108 00111 tVector3f mFaceOffset[Face_NumFaces]; 00112 tVector3f mFaceUnits[Face_NumFaces][2]; 00113 00118 tFloat mSubFaceRep; 00119 00121 void init(); 00122 00125 void free(); 00126 00127 }; // class 00128 00129 } // namespace 00130 00131 #endif |