Epsilon variable for double comparsons

This commit is contained in:
Emma Broman
2020-02-25 17:02:24 -05:00
parent 01820349b0
commit 3f5123ffb6

View File

@@ -31,7 +31,8 @@
#include <glm/gtx/projection.hpp>
namespace {
constexpr const char* _loggerCat = "PathCurve";
constexpr const char* _loggerCat = "PathCurve";
const double Epsilon = 1E-7;
} // namespace
namespace openspace::autonavigation {
@@ -170,10 +171,10 @@ glm::dvec3 Bezier3Curve::valueAt(double u) {
ghoul_assert((nrPoints - 1) % 3 == 0, "A vector containing 3n + 1 control points must be provided!");
ghoul_assert(_nrSegments == (nrTimes - 1), "Number of interval times must match number of intervals");
if (abs(u) < 0.000001)
if (abs(u) < Epsilon)
return _points.front();
if (abs(1.0 - u) < 0.000001)
if (abs(1.0 - u) < Epsilon)
return _points.back();
// compute current segment, by first finding iterator to the first value that is larger than s