Removed cmath dependency.

This commit is contained in:
2017-01-02 00:23:04 -04:00
parent 806040018e
commit e9986a923f
7 changed files with 13678 additions and 5418 deletions

View File

@@ -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);