00001 /* Crown and Cutlass 00002 * Ocean Object Header 00003 */ 00004 00005 #if !defined( _OCEAN_H_ ) 00006 00007 #define _OCEAN_H_ 00008 00009 #include <vector> 00010 00011 using namespace std; 00012 00013 class WaveEmitter; 00014 class Texture; 00015 00016 class Ocean { 00017 public: 00018 // Constructor 00019 Ocean(int sizeX, int sizeZ); 00020 00021 // Destructor 00022 ~Ocean(); 00023 00024 // Draw the actual water 00025 void Draw(); 00026 00027 // Update the water's position 00028 void Update(unsigned int ticks); 00029 00030 // Add a WaveEmitter to the master list 00031 void AddEmitter(WaveEmitter *emitter); 00032 00033 private: 00034 // Size of water patch 00035 int m_width; 00036 int m_height; 00037 00038 // Texture handle 00039 Texture *m_texture; 00040 00041 // Texture handle for waves 00042 Texture *m_waveTexture; 00043 00044 // Material 00045 GLfloat m_material[4]; 00046 00047 // For sin/cos to move texture 00048 GLfloat m_count; 00049 00050 // For display list 00051 GLuint m_list; 00052 00053 // Pointer to all of the wave emitters 00054 // Note: This makes update easier 00055 vector< WaveEmitter* > m_waveEmitters; 00056 }; 00057 00058 #endif
1.4.7