#pragma once

#include <GL/glew.h>
#include "CGMaterial.h"
#include "CGShaderProgram.h"

#define VERTEX_DATA 0
#define INDEX_DATA 1
#define NORMAL_DATA 2

class CGCloth {
private:
	GLfloat K;           // Wavenumber 
	GLfloat Velocity;    // Wave's velocity 
	GLfloat Amp;         // Wave's amplitude

	GLushort* indexes;   // Array of indexes 
	GLfloat* vertices;   // Array of vertices

	GLuint numFaces;     // Number of faces
	GLuint numVertices;  // Number of vertices
	GLuint VBO[2];
	GLuint VAO;

	glm::mat4 location;  // Model matrix
	CGMaterial* material;

public:
	CGCloth(GLfloat l1, GLfloat l2);
	~CGCloth();
	void InitBuffers();
	void SetMaterial(CGMaterial* mat);
	void ResetLocation();
	void Translate(glm::vec3 t);
	void Rotate(GLfloat angle, glm::vec3 axis);
	void Draw(CGShaderProgram* program, glm::mat4 projection, glm::mat4 view);
};


