From 96b7850cab53688901aeae071f9d9ffb5f8de17c Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Tue, 20 Oct 2015 04:05:58 +0200 Subject: [PATCH] Fix unintentional backface culling in triangle intersect This also fixes #194. The backface culling is unintentional because it is not documented anywhere and we can't give the triangle a normal so just assume the general case. --- glm/gtx/intersect.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/intersect.inl b/glm/gtx/intersect.inl index 0c1cc935..ac99351d 100644 --- a/glm/gtx/intersect.inl +++ b/glm/gtx/intersect.inl @@ -49,7 +49,7 @@ namespace glm typename genType::value_type a = glm::dot(e1, p); typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - if(a < Epsilon) + if(a < Epsilon && a > -Epsilon) return false; typename genType::value_type f = typename genType::value_type(1.0f) / a;