diff options
author | Hans Goudey <h.goudey@me.com> | 2021-04-22 20:24:52 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-04-22 20:24:52 +0300 |
commit | d7aa48123174c08a07366cfb7f5e3544b5c2fbb0 (patch) | |
tree | 7a6a92503fe7ac70d8d7ff46a06376b973a455dd /source/blender | |
parent | cd07fb6477932742affddb03ab2f347361e66992 (diff) |
Splines: Add comments
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/spline_nurbs.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/spline_nurbs.cc b/source/blender/blenkernel/intern/spline_nurbs.cc index 4181e8c6df6..f81dec2d8f3 100644 --- a/source/blender/blenkernel/intern/spline_nurbs.cc +++ b/source/blender/blenkernel/intern/spline_nurbs.cc @@ -301,6 +301,7 @@ static void calculate_basis_for_point(const float parameter, } } + /* Shrink the range of calculated values to avoid storing unecessary zeros. */ while (basis_buffer[start] == 0.0f && start < end) { start++; } @@ -334,6 +335,8 @@ void NURBSpline::calculate_basis_cache() const MutableSpan<BasisCache> basis_cache = this->weight_cache_; + /* This buffer is reused by each basis calculation to store temporary values. + * Theoretically it could likely be optimized away in the future. */ Array<float> basis_buffer(this->knots_size()); const float start = knots[order - 1]; |