fix how reflexiveness is applied to materials and scenenodes
This commit is contained in:
parent
199765e112
commit
6c7e6de5a8
|
@ -61,7 +61,7 @@ void SceneNode::setTexture(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void SceneNode::setMaterial(const Material& mat, bool recursive) {
|
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_diffuse) diffuse_color = mat.diffuse_color;
|
||||||
if (!mat.ignore_emissive) emissive_color = mat.emissive_color;
|
if (!mat.ignore_emissive) emissive_color = mat.emissive_color;
|
||||||
if (!mat.ignore_specular) specular_color = mat.specular_color;
|
if (!mat.ignore_specular) specular_color = mat.specular_color;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "material.hpp"
|
#include "material.hpp"
|
||||||
#include "imageLoader.hpp"
|
#include "imageLoader.hpp"
|
||||||
|
|
||||||
|
// applies other on top of this, creating a new material
|
||||||
Material Material::apply(const Material& other) const {
|
Material Material::apply(const Material& other) const {
|
||||||
Material out(*this);
|
Material out(*this);
|
||||||
|
|
||||||
|
@ -24,7 +25,6 @@ Material Material::apply(const Material& other) const {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Material Material::diffuse(glm::vec3 color) const {
|
Material Material::diffuse(glm::vec3 color) const {
|
||||||
Material out(*this);
|
Material out(*this);
|
||||||
out.diffuse_color = color;
|
out.diffuse_color = color;
|
||||||
|
|
Loading…
Reference in New Issue