diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-21 16:30:07 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-21 16:30:07 +0300 |
commit | 4ba6bac2f1a45fbd0715dd076992cf21f41f262f (patch) | |
tree | afef432ed90a76ccf9806f520e6370a8108156d4 /source/blender/blenlib/BLI_length_parameterize.hh | |
parent | 63be57307eba75c05e7584a2e43373e489b451fb (diff) |
Fix build error in tests binary after previous commit
Also remove an unused include and add a comment,
const, use the math namespace.
Diffstat (limited to 'source/blender/blenlib/BLI_length_parameterize.hh')
-rw-r--r-- | source/blender/blenlib/BLI_length_parameterize.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_length_parameterize.hh b/source/blender/blenlib/BLI_length_parameterize.hh index 035d4d04787..1b494c021a3 100644 --- a/source/blender/blenlib/BLI_length_parameterize.hh +++ b/source/blender/blenlib/BLI_length_parameterize.hh @@ -9,7 +9,6 @@ #include "BLI_math_base.hh" #include "BLI_math_color.hh" #include "BLI_math_vector.hh" -#include "BLI_vector.hh" namespace blender::length_parameterize { @@ -75,6 +74,7 @@ struct SampleSegmentHint { /** * \param accumulated_segment_lengths: Lengths of individual segments added up. + * Each value describes the total length at the end of the segment following a point. * \param sample_length: The position to sample at. * \param r_segment_index: Returns the index of the segment that #sample_length is in. * \param r_factor: Returns the position within the segment. @@ -82,7 +82,7 @@ struct SampleSegmentHint { * \note #sample_length must not be outside of any segment. */ inline void sample_at_length(const Span<float> accumulated_segment_lengths, - float sample_length, + const float sample_length, int &r_segment_index, float &r_factor, SampleSegmentHint *hint = nullptr) @@ -117,7 +117,7 @@ inline void sample_at_length(const Span<float> accumulated_segment_lengths, const float segment_start = prev_point_index == 0 ? 0.0f : lengths[prev_point_index - 1]; const float segment_end = lengths[prev_point_index]; const float segment_length = segment_end - segment_start; - const float segment_length_inv = safe_divide(1.0f, segment_length); + const float segment_length_inv = math::safe_divide(1.0f, segment_length); const float length_in_segment = sample_length - segment_start; const float factor = length_in_segment * segment_length_inv; |