From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/water__height__map_8h-source.html | 254 +++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 docs/doxygen/nel/water__height__map_8h-source.html (limited to 'docs/doxygen/nel/water__height__map_8h-source.html') diff --git a/docs/doxygen/nel/water__height__map_8h-source.html b/docs/doxygen/nel/water__height__map_8h-source.html new file mode 100644 index 00000000..7c82284c --- /dev/null +++ b/docs/doxygen/nel/water__height__map_8h-source.html @@ -0,0 +1,254 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# Home   # nevrax.com   
+ + + + +
Nevrax
+ + + + + + + + + + +
+ + +
+ Nevrax.org
+ + + + + + + +
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
+
+ + +
+ + +
+Docs + +
+  + + + + + +
Documentation 
+ +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  
+

water_height_map.h

Go 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 
+00027 #ifndef WATER_HEIGHT_MAP_H
+00028 #define WATER_HEIGHT_MAP_H
+00029 
+00030 
+00031 #include "nel/misc/types_nl.h"
+00032 #include "nel/misc/vector_2f.h"
+00033 #include "nel/3d/u_water.h"
+00034 #include "nel/3d/animation_time.h"
+00035 
+00036 
+00037 #include <vector>
+00038 #include <string>
+00039 
+00040 
+00041 
+00042 
+00043 namespace NL3D
+00044 {
+00045 
+00046 
+00047 class CWaterPoolManager;
+00048 
+00049 
+00065 const uint NumWaterMap = 3; // number of water maps
+00066 
+00067 class CWaterHeightMap : public UWaterHeightMap
+00068 {
+00069 public:
+00070         
+00074         void animate(float deltaT);
+00075 
+00079         void                                    setSize(uint32 size);
+00080 
+00082         uint32                                  getSize(void) const { return _Size; }
+00083 
+00085 
+00091         void                                    setUserPos(sint x, sint y);
+00092 
+00093 
+00097         void                                    getUserPos(sint &x, sint &y) const;
+00098 
+00099         
+00100 
+00102         void                                    perturbate(sint x, sint y, sint radius, float intensity);
+00103 
+00106         virtual void    perturbate(const NLMISC::CVector2f &pos, float strenght, float radius) ;
+00107 
+00108 
+00110         void                                    perturbatePoint(sint x, sint y, float intensity);
+00111 
+00114         virtual void    perturbatePoint(const NLMISC::CVector2f &pos, float strenght);
+00115 
+00118         virtual float   getHeight(const NLMISC::CVector2f &pos);
+00119         
+00120 
+00122         float                                   *getPointer(void) { return &(_Map[_CurrMap][0]); }
+00123 
+00125         float                                   *getPrevPointer(void) { return &(_Map[(_CurrMap + (NumWaterMap - 1)) % NumWaterMap][0]); }
+00126 
+00128         float                                   getBufferRatio() const { return _PropagationTime != 0 ? _PropagateEllapsedTime / _PropagationTime : 0.f; }
+00129 
+00131         //NLMISC::CVector2f             *getGradPointer(void) { return &_Grad[0]; }
+00132         
+00133 
+00135         void                                    enableWaves(bool enabled = true) { _WavesEnabled = enabled; }
+00136 
+00138         bool                                    areWavesEnabled() const { return _WavesEnabled; }
+00139 
+00147         void                                    setWaves(float intensity, float period, uint radius, bool border);
+00148 
+00150         float                                   getWaveIntensity() const { return _WaveIntensity; }
+00151 
+00153         float                                   getWavePeriod() const { return _WavePeriod; }
+00154 
+00156         uint32                                  getWaveImpulsionRadius() const { return _WaveImpulsionRadius; }
+00157 
+00159         bool                                    getBorderWaves() const { return _BorderWaves; }
+00160 
+00162         void                                    setDamping(float damping) { nlassert(damping >= 0 && damping < 1); _Damping = damping; }
+00163         float                                   getDamping() const { return _Damping; }
+00164 
+00166         void                                    setFilterWeight(float filterWeight) { _FilterWeight = filterWeight; }
+00167         float                                   getFilterWeight() const { return _FilterWeight; }
+00168 
+00170         void                                    setUnitSize(float unitSize) { _UnitSize = unitSize; }
+00171         float                                   getUnitSize() const { return _UnitSize; }
+00172 
+00174         sint64                                  Date;
+00175 
+00177         void                                    serial(NLMISC::IStream &f)  throw(NLMISC::EStream);
+00178 
+00180         void                                    setName(const std::string &name) { _Name = name; }
+00181 
+00183         const std::string               &getName() const { return _Name; }
+00184 
+00185         // ctor (use the water pool manager instead)
+00186         CWaterHeightMap();
+00187         // dtor
+00188         virtual ~CWaterHeightMap() {}
+00189 
+00191         void                                    setPropagationTime(float time);
+00192 
+00194         TAnimationTime                  getPropagationTime() const { return _PropagationTime; }
+00195 
+00196 
+00197 private:
+00198         void animateWaves(float deltaT);
+00199 
+00200         void updateUserPos();
+00201 
+00202         void animatePart(float startTime, float endTime);
+00203 
+00208         void                                    propagate(uint startLine, uint endLine);
+00209         
+00210 
+00212         void                                    filter(uint startLine, uint endLine);
+00213 
+00215         void                                    swapBuffers(float deltaT);
+00216 
+00217 
+00218         friend class CWaterPoolManager;
+00219 
+00220         std::string                _Name;       
+00221         bool                                       _WavesEnabled;
+00222         float                                      _Damping;
+00223         float                                      _FilterWeight;
+00224         float                                      _UnitSize;
+00225         float                                      _WaveIntensity;
+00226         float                                      _WavePeriod;
+00227         uint32                                     _WaveImpulsionRadius;
+00228         bool                                       _BorderWaves;
+00229         float                                      _EmitEllapsedTime;
+00230         float                                      _PropagateEllapsedTime;
+00231         TAnimationTime             _PropagationTime; // the time needed to perform a propagation, this allow split the propagation computation over time.
+00232 
+00233 
+00234         uint                                       _X, _Y;      
+00235         uint                                       _NewX, _NewY;        
+00236         typedef std::vector<float>                              TFloatVect;
+00237         typedef std::vector<NLMISC::CVector2f > TFloat2Vect;
+00238 
+00239         TFloatVect                                 _Map[NumWaterMap]; // the 2 maps used for propagation
+00240         //TFloat2Vect                              _Grad;   // used to store the gradient 
+00241         uint8                                      _CurrMap;    
+00242         uint32                                     _Size;       
+00243 
+00245         void                                            clearArea(uint8 currMap, sint x, sint y, sint width, sint height);
+00246         // same than clearArea, but perform on both maps
+00247         void                                            clearZone(sint x, sint y, sint width, sint height);
+00249         void                                            makeCpy(uint buffer, uint dX, uint dY, uint sX, uint sY, uint width, uint height);
+00250 
+00252         void                                            clearBorder(uint currMap);
+00253 
+00254 
+00255 };
+00256 
+00257 } // NL3D
+00258 
+00259 #endif
+
+ + +
                                                                                                                                                                    +
+ + -- cgit v1.2.1