00001 00005 /* Copyright, 2000, 2001 Nevrax Ltd. 00006 * 00007 * This file is part of NEVRAX NEL. 00008 * NEVRAX NEL is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2, or (at your option) 00011 * any later version. 00012 00013 * NEVRAX NEL is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * General Public License for more details. 00017 00018 * You should have received a copy of the GNU General Public License 00019 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00020 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00021 * MA 02111-1307, USA. 00022 */ 00023 00024 #ifndef NL_U_WATER_INSTANCE_H 00025 #define NL_U_WATER_INSTANCE_H 00026 00027 #include "nel/misc/types_nl.h" 00028 #include "u_instance.h" 00029 00030 00031 namespace NLMISC 00032 { 00033 class CVector2f; 00034 class CVector; 00035 }; 00036 00037 00038 namespace NL3D { 00039 00040 class UDriver; 00041 00042 class UWaterHeightMap; 00043 00044 00052 class UWaterInstance : public UInstance 00053 { 00054 public: 00059 uint32 getWaterHeightMapID() const; 00060 00064 float getHeightFactor() const; 00065 00067 float getHeight(const NLMISC::CVector2f &pos); 00068 00073 float getAttenuatedHeight(const NLMISC::CVector2f &pos, const NLMISC::CVector &viewer); 00074 00076 00078 UWaterInstance() { _Object = NULL; } 00079 UWaterInstance(class CWaterModel *object) { _Object = (ITransformable*)object; }; 00081 void attach(class CWaterModel *object) { _Object = (ITransformable*)object; }; 00083 void detach() { _Object = NULL; } 00085 bool empty() const {return _Object==NULL;} 00087 class CWaterModel *getObjectPtr() const {return (CWaterModel*)_Object;} 00088 }; 00089 00090 00092 class UWaterHeightMapManager 00093 { 00094 public: 00096 static UWaterHeightMap &getWaterHeightMapFromID(uint32 ID); 00097 00102 static void setBlendFactor(UDriver *driver, float value); 00105 static void releaseBlendTextures(); 00106 00107 }; 00108 00110 class UWaterHeightMap 00111 { 00112 public: 00113 virtual ~UWaterHeightMap() {} 00114 00116 virtual float getUnitSize() const =0; 00117 00123 virtual void perturbate(const NLMISC::CVector2f &pos, float strenght, float radius) =0; 00124 00129 virtual void perturbatePoint(const NLMISC::CVector2f &pos, float strenght) =0; 00130 00134 virtual float getHeight(const NLMISC::CVector2f &pos) =0; 00135 }; 00136 00137 00138 00139 00140 00141 } // NL3D 00142 00143 00144 #endif // NL_U_WATER_INSTANCE_H 00145 00146 /* End of u_water_instance.h */
1.6.1