src/geometry.cpp

changeset 58
b7841cd31fb7
parent 55
cb81ecb5fb23
child 64
f99d52b1646b
--- a/src/geometry.cpp	Thu Feb 27 11:56:41 2020 +0200
+++ b/src/geometry.cpp	Thu Feb 27 12:23:42 2020 +0200
@@ -17,10 +17,10 @@
  * @param plane
  * @return point of intersection. Does not return a value if the line is in parallel to the plane.
  */
-std::optional<glm::vec3> geom::linePlaneIntersection(const geom::Line& line, const geom::Plane& plane)
+std::optional<glm::vec3> geom::linePlaneIntersection(const geom::Line& line, const geom::Plane& plane, const float epsilon)
 {
 	const float denominator = glm::dot(line.direction, plane.normal);
-	if (std::abs(denominator) < 1e-8f)
+	if (std::abs(denominator) < epsilon)
 	{
 		return {};
 	}

mercurial