mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-14 17:40:26 -05:00
Avoid checking agains espilon at the end of curve interpolation
For long paths this epsilon corresponds to a large portion of the curve and will result in clipping to the start and/or end state
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
|
||||
namespace {
|
||||
constexpr const char* _loggerCat = "AvoidCollisionCurve";
|
||||
const double Epsilon = 1E-7;
|
||||
|
||||
const double CloseToNodeThresholdFactor = 5.0;
|
||||
const double AvoidCollisionDistanceFactor = 3.0;
|
||||
@@ -112,10 +111,10 @@ AvoidCollisionCurve::AvoidCollisionCurve(const Waypoint& start, const Waypoint&
|
||||
|
||||
// Interpolate a list of control points and knot times
|
||||
glm::dvec3 AvoidCollisionCurve::interpolate(double u) {
|
||||
if (u < Epsilon) {
|
||||
if (u <= 0.0) {
|
||||
return _points[1];
|
||||
}
|
||||
if (u > (1.0 - Epsilon)) {
|
||||
if (u > 1.0) {
|
||||
return *(_points.end() - 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
|
||||
namespace {
|
||||
constexpr const char* _loggerCat = "ZoomOutOverviewCurve";
|
||||
const double Epsilon = 1E-12;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -94,9 +93,9 @@ ZoomOutOverviewCurve::ZoomOutOverviewCurve(const Waypoint& start, const Waypoint
|
||||
}
|
||||
|
||||
glm::dvec3 ZoomOutOverviewCurve::interpolate(double u) {
|
||||
if (u < Epsilon)
|
||||
if (u <= 0.0)
|
||||
return _points[0];
|
||||
if (u > (1.0 - Epsilon))
|
||||
if (u > 1.0)
|
||||
return _points.back();
|
||||
|
||||
return interpolation::piecewiseCubicBezier(u, _points, _parameterIntervals);
|
||||
|
||||
Reference in New Issue
Block a user