Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Water.h
Go to the documentation of this file.
1 /* Project nGenEx
2  Destroyer Studios LLC
3  Copyright © 1997-2006. All Rights Reserved.
4 
5  SUBSYSTEM: nGen.lib
6  FILE: Water.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Water surface effect w/ reflection and refraction
13 */
14 
15 #ifndef Water_h
16 #define Water_h
17 
18 #include "Geometry.h"
19 #include "Polygon.h"
20 #include "Color.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 struct WATER_SURFACE;
25 
26 // +--------------------------------------------------------------------+
27 
28 class Water
29 {
30 public:
31  Water();
32  virtual ~Water();
33 
34  virtual void Init(int nVerts, float size, float depth);
35  virtual void CalcWaves(double seconds);
36  virtual void UpdateSurface(Vec3& eyePos, VertexSet* vset);
37 
38 protected:
39  float size;
40  float depth;
41  float scaleTex;
42  float avgHeight;
43 
44  DWORD nVertices;
45 
47  float* waves;
48  float offsets[16];
49 };
50 
51 // +--------------------------------------------------------------------+
52 
53 #endif Water_h
54