#pragma once #include "./Object3d.h" #include "./GameManager.h" #include #include "Node.h" using namespace std; #define SPTR boost::shared_ptr class Ocean: public Node { public: Ocean(void); ~Ocean(void); void generateOcean(float deepC [4], float shallowC [4]); void setTextures(std::string texture0, std::string texture1, std::string watermap); private: struct Vertex { Vertex(float _x, float _y, float _z, float _nx, float _ny, float _nz, DWORD _color, float _u, float _v) { x = _x; y = _y; z = _z; nx = _nx; ny = _ny; nz = _nz; color = _color; u = _u; v = _v; } float x, y, z; float nx, ny, nz; DWORD color; float u, v; enum FVF { FVF_Flags = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1 }; }; void loadEffect(float *deepC, float *shallowC); std::string texture0; std::string texture1; std::string watermap; std::vector oceanPatches; Vector *normals; D3DMATERIAL9 *standardMats; std::vector Textures; //effect: ID3DXEffect* OceanEffect; D3DXHANDLE TexHandleWaves; D3DXHANDLE TexHandleCubemap; D3DXHANDLE TexHandleTerrain; D3DXHANDLE ShallowColorHandle; D3DXHANDLE DeepColorHandle; D3DXHANDLE DimensionHandle; };