#ifndef _WATER
#define _WATER

class sv3 
{	
	public:
		sv3() {v[0]=0;v[1]=0;v[2]=0;};
		void set(float x,float y,float z) {v[0]=x;v[1]=y;v[2]=z;};
		float v[3]; 
};


class Water
{
public:
	Water();
	~Water();

	void Init(int sx, int sz, float ddx, float ddz, float r); //sx,sz: #mesh size, ddx,ddz:meshintervall
	void Update(float timestep);
	void Render();
	void EmbossSphere(float *pos);	//pos[3]

	sv3		*wv, *wn;			//vertex & normal array
	float		*wvv;				//vertical velocity
	int		nx,nz;				//#vertices in x & z direction
	float		dx, dz;			//mesh interval
	float		diffmat[4];	//diffusive part of the material
	float		c;					//wave equation constant
	float		w;					//damping constant w E [0,1]

private:
	float		r;					//sphere radius for EmbossSphere
	int		rix,riz;			//converted sphere radius in respect to mesh intervals
	int		*outer;				//used by EmbossSphere to keep track of outer points
	int		osize;				//size of outer[]
};

#endif