void Mesh::setInstanceData(const std::vector<glm::mat4>& transformData)

{

glBindVertexArray(mVAO_Handle);

// set the instance data buffers

GLsizei instanceDataSize = transformData.size() * sizeof(glm::mat4);

glBindBuffer(GL_ARRAY_BUFFER, mVBO_Array[INST_OFFSET]);

glBufferData(GL_ARRAY_BUFFER, instanceDataSize, transformData.data(), GL_STATIC_DRAW);

glEnableVertexAttribArray(3);

glVertexAttribPointer(3, 4, GL_FLOAT, GL_FALSE, sizeof(glm::mat4), (GLvoid*) 0);

glVertexAttribDivisor(3, 1); // increment instances by 1 each iteration

glEnableVertexAttribArray(4);

glVertexAttribPointer(4, 4, GL_FLOAT, GL_FALSE, sizeof(glm::mat4), (GLvoid*) (sizeof(glm::vec4)));

glVertexAttribDivisor(4, 1);

glEnableVertexAttribArray(5);

glVertexAttribPointer(5, 4, GL_FLOAT, GL_FALSE, sizeof(glm::mat4), (GLvoid*) (2 * sizeof(glm::vec4)));

glVertexAttribDivisor(5, 1);

glEnableVertexAttribArray(6);

glVertexAttribPointer(6, 4, GL_FLOAT, GL_FALSE, sizeof(glm::mat4), (GLvoid*) (3 * sizeof(glm::vec4)));

glVertexAttribDivisor(6, 1);

glBindBuffer(GL_ARRAY_BUFFER, 0);

glBindVertexArray(0);

}