#include "WaveMesh.h"

float WaveMesh::heightMapFunc(std::size_t nx, std::size_t ny, float fx, float fy) const {
	double d = 50*sqrt(fx*fx + fy*fy);
	return static_cast<float>(cos(d - _shift)*exp(-d/10.0f)/2);
}

void WaveMesh::setShift(float shift) {
	_shift = shift;
	update();
}

WaveMesh::WaveMesh(ShaderProgram *shader, std::size_t size): Mesh(shader, size), _shift(0) {

}

WaveMesh::~WaveMesh() {

}
