fix how reflexiveness is applied to materials and scenenodes

This commit is contained in:
Peder Bergebakken Sundt 2019-03-28 09:39:38 +01:00
parent 199765e112
commit 6c7e6de5a8
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ void SceneNode::setTexture(
}
}
void SceneNode::setMaterial(const Material& mat, bool recursive) {
reflexiveness = mat.reflexiveness;
if(mat.reflection_texture)reflexiveness = mat.reflexiveness;
if (!mat.ignore_diffuse) diffuse_color = mat.diffuse_color;
if (!mat.ignore_emissive) emissive_color = mat.emissive_color;
if (!mat.ignore_specular) specular_color = mat.specular_color;

View File

@ -2,6 +2,7 @@
#include "material.hpp"
#include "imageLoader.hpp"
// applies other on top of this, creating a new material
Material Material::apply(const Material& other) const {
Material out(*this);
@ -24,7 +25,6 @@ Material Material::apply(const Material& other) const {
return out;
}
Material Material::diffuse(glm::vec3 color) const {
Material out(*this);
out.diffuse_color = color;