From 1cc1ed86486165bb31782bdcc3a2760691d55298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 9 Apr 2023 15:57:07 +0200 Subject: [PATCH] Math: use T instead of Float for Bezier subdivision. Mixing double and single precision together doesn't make sense in case of Bezier. --- src/Magnum/Math/Bezier.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h index f2760997b..5e6a9f7c7 100644 --- a/src/Magnum/Math/Bezier.h +++ b/src/Magnum/Math/Bezier.h @@ -181,7 +181,7 @@ template class Bezier { * the [De Casteljau's algorithm](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm). * @see @ref subdivide() */ - Vector value(Float t) const { + Vector value(T t) const { Bezier iPoints[order + 1]; calculateIntermediatePoints(iPoints, t); return iPoints[0][order]; @@ -194,7 +194,7 @@ template class Bezier { * given interpolation factor. Uses the [De Casteljau's algorithm](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm). * @see @ref value() */ - std::pair, Bezier> subdivide(Float t) const { + std::pair, Bezier> subdivide(T t) const { Bezier iPoints[order + 1]; calculateIntermediatePoints(iPoints, t); Bezier left, right; @@ -214,7 +214,7 @@ template class Bezier { template constexpr explicit Bezier(Corrade::Containers::Implementation::Sequence, U): _data{Vector((static_cast(sequence), U{typename U::Init{}}))...} {} /* Calculates and returns all intermediate points generated when using De Casteljau's algorithm */ - void calculateIntermediatePoints(Bezier(&iPoints)[order + 1], Float t) const { + void calculateIntermediatePoints(Bezier(&iPoints)[order + 1], T t) const { for(std::size_t i = 0; i <= order; ++i) { iPoints[i][0] = _data[i]; }