diff options
author | Hans Goudey <h.goudey@me.com> | 2021-06-22 07:07:26 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-06-22 07:07:26 +0300 |
commit | e1d6219731fc38c40f3dc55224e8ab6cfb217dd2 (patch) | |
tree | d11d7c6db56437ecd4c3fd3966bc746dc79d65a3 /source/blender/blenkernel/intern/spline_base.cc | |
parent | dc3b7602eeb08df788c6dcd1dee6860d58a5010d (diff) |
Cleanup: Use "size" instead of "points_len" in spline code
Previously this was mostly consistent, but not completely. It's helpful
to use the same name for the same meaning everywhere in this area.
Diffstat (limited to 'source/blender/blenkernel/intern/spline_base.cc')
-rw-r--r-- | source/blender/blenkernel/intern/spline_base.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/spline_base.cc b/source/blender/blenkernel/intern/spline_base.cc index b3514f23784..c18f44e07b2 100644 --- a/source/blender/blenkernel/intern/spline_base.cc +++ b/source/blender/blenkernel/intern/spline_base.cc @@ -74,9 +74,9 @@ float Spline::length() const int Spline::segments_size() const { - const int points_len = this->size(); + const int size = this->size(); - return is_cyclic_ ? points_len : points_len - 1; + return is_cyclic_ ? size : size - 1; } bool Spline::is_cyclic() const @@ -411,23 +411,23 @@ Array<float> Spline::sample_uniform_index_factors(const int samples_size) const Spline::LookupResult Spline::lookup_data_from_index_factor(const float index_factor) const { - const int points_len = this->evaluated_points_size(); + const int eval_size = this->evaluated_points_size(); if (is_cyclic_) { - if (index_factor < points_len) { + if (index_factor < eval_size) { const int index = std::floor(index_factor); - const int next_index = (index < points_len - 1) ? index + 1 : 0; + const int next_index = (index < eval_size - 1) ? index + 1 : 0; return LookupResult{index, next_index, index_factor - index}; } - return LookupResult{points_len - 1, 0, 1.0f}; + return LookupResult{eval_size - 1, 0, 1.0f}; } - if (index_factor < points_len - 1) { + if (index_factor < eval_size - 1) { const int index = std::floor(index_factor); const int next_index = index + 1; return LookupResult{index, next_index, index_factor - index}; } - return LookupResult{points_len - 2, points_len - 1, 1.0f}; + return LookupResult{eval_size - 2, eval_size - 1, 1.0f}; } void Spline::bounds_min_max(float3 &min, float3 &max, const bool use_evaluated) const |