Saxum/object.cc

27 lines
852 B
C++
Raw Normal View History

2014-10-22 22:13:09 +00:00
#include "object.hh"
Object::Object(Model model, Material material, glm::vec3 position, glm::vec3 rotation,
glm::vec3 velocity, glm::vec3 angularVelocity, ACGL::OpenGL::SharedShaderProgram shader) :
Entity(position, rotation) {
2014-10-22 22:13:09 +00:00
this->model = model.getReference();
this->material = material;
2014-10-22 22:13:09 +00:00
this->velocity = velocity;
this->angularVelocity = angularVelocity;
this->shader = shader;
2014-10-22 22:13:09 +00:00
}
Object::Object() {
}
2014-10-22 22:13:09 +00:00
Object::~Object() {
}
void Object::render() {
shader->setUniform("ambientFactor", material.getAmbientFactor());
shader->setUniform("diffuseFactor", material.getDiffuseFactor());
shader->setUniform("specularFactor", material.getSpecularFactor());
shader->setUniform("shininess", material.getShininess());
shader->setTexture("uTexture", material.getReference(), 0);
model->render();
2014-10-22 22:13:09 +00:00
}