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,16 +1,14 @@
#include <cmath>
#include "plane.hpp"
#define TOL 1e-6
using std::fabs;
using glm::abs;
using glm::dot;
bool Plane::intersect(Ray & r, float & t) const {
float d = dot(r.m_direction, m_normal);
if (fabs(d) > TOL) {
if (abs(d) > TOL) {
t = dot(m_normal, (m_point - r.m_origin)) / d;
return t >= 0.0f;
}