#include "mesh.h"

/*
 * Default constructor
 */
Mesh::Mesh()
{}

/*
 * Default deconstructor
 */
Mesh::~Mesh()
{}

/*
 * Constructor
 * float *_vertexPositions - pointer to the array with the position of the vertices
 * float *_normals - pointer to the array with the position of the normals
 * float *_textureCoordinates - pointer to the array with the texture coordinates
 * GLuint *_indices - indices array of the mesh
 * int _indicesArraySize - size of the inidces array
 * int _arraySize - size of the vertices, normals, texture arrays
 * float *_tangents - pointer to the array with the tangent information at the vertices
 */
Mesh::Mesh(float *_vertexPositions, float *_normals, float *_textureCoordinates, GLuint *_indices, int _indicesArraySize, int _arraySize,
	float *_tangents, float *_dimension)
{
	vertexPositions = _vertexPositions;
	normals = _normals;
	textureCoordinates = _textureCoordinates;
	indices = _indices;
	indicesArraySize = _indicesArraySize;
	elementcount = _arraySize;
	tangents = _tangents;
	dimension = _dimension;
}

/*
 * Get the size of the indices array
 * return size of the indices array
 */
GLuint Mesh::getIndicesCount()
{
	return indicesArraySize;
}

/*
 * Get the size of the arrays for vertices, normals, texture coordinates
 * return size of the arrays for vertices, normals, texture coordinates
 */
int Mesh::getElementCount()
{
	return elementcount;
}

/*
 * Get the array with the position of the vertices
 * return pointer to the positions of the vertices
 */
float* Mesh::getVertices()
{
	return vertexPositions;
}

/*
 * Get the array with the position of the normals
 * return pointer to the positions of the normals
 */
float* Mesh::getNormals()
{
	return normals;
}

/*
 * Get the array with the texture coordinates
 * return pointer to the texture coordinates
 */
float* Mesh::getTextureCoordinates()
{
	return textureCoordinates;
}

/*
 * Get the array with the indices
 * return pointer to the indices
 */
GLuint* Mesh::getIndices()
{
	return indices;
}


/*
 * Get the array with the texture coordinate
 * return pointer to the tangent information
 */
float* Mesh::getTangents()
{
	return tangents;
}


/*
 * Get the array with the dimension in order
 * x - y - z - w
 * return pointer to the dimension of the model
 */
float* Mesh::getDim()
{
	return dimension;
}

glm::vec3 Mesh::getDimVec() const {
	return glm::vec3(dimension[0], dimension[1], dimension[2]);
}