#include "entity.h" #include "shader.h" #include #include "material.h" #include "mesh.h" void Entity::draw(const glm::mat4 viewMatrix, const glm::mat4 projectionMatrix) { glm::mat4 modelViewMatrix = viewMatrix * modelMatrix; glm::mat4 mvp = projectionMatrix * modelViewMatrix; Shader* shader = mat->getShader(); shader->bind(); mat->bindAttributes(); shader->bindMatrix(shader->getLocation("viewMatrix"), viewMatrix); shader->bindMatrix(shader->getLocation("modelViewMatrix"), modelViewMatrix); shader->bindMatrix(shader->getLocation("MVP"), mvp); mesh->draw(); }