Home | nevrax.com |
|
water_model.hGo to the documentation of this file.00001 00007 /* Copyright, 2000, 2001 Nevrax Ltd. 00008 * 00009 * This file is part of NEVRAX NEL. 00010 * NEVRAX NEL is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2, or (at your option) 00013 * any later version. 00014 00015 * NEVRAX NEL is distributed in the hope that it will be useful, but 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 00020 * You should have received a copy of the GNU General Public License 00021 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00022 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00023 * MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef NL_WATER_MODEL_H 00027 #define NL_WATER_MODEL_H 00028 00029 #include "nel/misc/types_nl.h" 00030 #include "3d/transform_shape.h" 00031 #include "nel/3d/u_water.h" 00032 00033 namespace MISC 00034 { 00035 class CVector; 00036 } 00037 00038 namespace NL3D { 00039 00040 00041 class CWaterPoolManager; 00042 class CWaterShape; 00043 class IDriver; 00044 class CScene; 00045 00052 class CWaterModel : public CTransformShape, public UWaterInstance 00053 { 00054 public: 00056 CWaterModel(); 00057 00058 // register this model and his observers 00059 static void registerBasic(); 00060 static IModel *creator() { return new CWaterModel; } 00061 00062 // get default tracks 00063 virtual ITrack* getDefaultTrack (uint valueId); 00064 00066 virtual uint32 getWaterHeightMapID() const; 00067 00069 virtual float getHeightFactor() const; 00070 00072 virtual float getHeight(const NLMISC::CVector2f &pos); 00073 00075 virtual float getAttenuatedHeight(const NLMISC::CVector2f &pos, const NLMISC::CVector &viewer); 00076 protected: 00077 friend class CWaterRenderObs; 00078 friend class CWaterShape; 00079 CScene *_Scene; 00080 00081 }; 00082 00083 //===================================================================================================================== 00084 00085 00086 class CWaterRenderObs : public CTransformShapeRenderObs 00087 { 00088 public: 00089 virtual void traverse(IObs *caller); 00090 static IObs *creator() {return new CWaterRenderObs;} 00091 private: 00092 void setupMaterialNVertexShader(IDriver *drv, CWaterShape *shape, const NLMISC::CVector &obsPos, bool above, float maxDist, float zHeight); 00094 //void setAttenuationFactor(IDriver *drv, bool reversed, const NLMISC::CVector &obsPos, const NLMISC::CVector &cameraJ, float farDist); 00095 // disable attenuation with distance 00096 //void disableAttenuation(IDriver *drv); 00097 }; 00098 00099 00100 //===================================================================================================================== 00101 00103 class CWaveMakerModel : public CTransformShape 00104 { 00105 public: 00106 00107 CWaveMakerModel(); 00108 00109 // register this model and his observers 00110 static void registerBasic(); 00111 00112 static IModel *creator() { return new CWaveMakerModel; } 00113 00114 // get default tracks 00115 virtual ITrack* getDefaultTrack (uint valueId); 00116 00117 protected: 00118 00119 friend class CWaveMakerDetailObs; 00120 friend class CWaveMakerShape; 00121 TAnimationTime _Time; 00122 CScene *_Scene; 00123 }; 00124 00125 //===================================================================================================================== 00126 class CWaveMakerDetailObs : public CTransformAnimDetailObs 00127 { 00128 public: 00129 00134 virtual void traverse(IObs *caller); 00135 public: 00136 static IObs *creator() { return new CWaveMakerDetailObs; } 00137 }; 00138 00139 00140 00141 } // NL3D 00142 00143 00144 #endif // NL_WATER_MODEL_H 00145 00146 /* End of water_model.h */ |