Removed cmath dependency.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#include <cmath>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/constants.hpp>
|
||||
|
||||
@@ -8,12 +6,14 @@
|
||||
using glm::pi;
|
||||
using glm::reflect;
|
||||
using glm::dot;
|
||||
using glm::pow;
|
||||
using glm::max;
|
||||
|
||||
vec3 DirectionalLight::shade(vec3 normal, Ray & r, Material & m) const {
|
||||
float n_dot_l, r_dot_l;
|
||||
vec3 color, ref;
|
||||
|
||||
n_dot_l = max(dot(normal, m_position), 0.0);
|
||||
n_dot_l = max(dot(normal, m_position), 0.0f);
|
||||
color += (m.m_diffuse / pi<float>()) * m_diffuse * n_dot_l;
|
||||
|
||||
ref = reflect(m_position, normal);
|
||||
|
Reference in New Issue
Block a user