Fix: Incorrect logic in spline lookup function
This section of code deals with evaluated points, so that is the size it should use.
This commit is contained in:
parent
3c8d261557
commit
9eafdb985d
|
@ -410,7 +410,7 @@ Spline::LookupResult Spline::lookup_evaluated_length(const float length) const
|
|||
|
||||
const float *offset = std::lower_bound(lengths.begin(), lengths.end(), length);
|
||||
const int index = offset - lengths.begin();
|
||||
const int next_index = (index == this->size() - 1) ? 0 : index + 1;
|
||||
const int next_index = (index == this->evaluated_points_size() - 1) ? 0 : index + 1;
|
||||
|
||||
const float previous_length = (index == 0) ? 0.0f : lengths[index - 1];
|
||||
const float factor = (length - previous_length) / (lengths[index] - previous_length);
|
||||
|
|
Loading…
Reference in New Issue