fix type in smoothstep
This commit is contained in:
parent
f537d94c9c
commit
180e1f77fa
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ namespace bwidgets
|
||||||
[[nodiscard]] inline auto smoothstep(const N x, const N a, const N b) noexcept
|
[[nodiscard]] inline auto smoothstep(const N x, const N a, const N b) noexcept
|
||||||
-> float
|
-> float
|
||||||
{
|
{
|
||||||
const float x_norm = linear(std::clamp<float>(x, a, b), a, b);
|
const float x_norm = linear(std::clamp<double>(x, a, b), static_cast<double>(a), static_cast<double>(b));
|
||||||
return 3 * x_norm * x_norm - 2 * x_norm * x_norm * x_norm;
|
return 3 * x_norm * x_norm - 2 * x_norm * x_norm * x_norm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue