Skip to content

Commit 13e405d

Browse files
authored
Circularにlerp関数を追加 (#1206)
#1203
1 parent 33ec928 commit 13e405d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Siv3D/include/Siv3D/Circular.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# include "PointVector.hpp"
1515
# include "FastMath.hpp"
1616
# include "PredefinedNamedParameter.hpp"
17+
# include "Interpolation.hpp"
1718

1819
namespace s3d
1920
{
@@ -75,6 +76,9 @@ namespace s3d
7576

7677
constexpr CircularBase& rotate(value_type angle) noexcept;
7778

79+
[[nodiscard]]
80+
CircularBase lerp(const CircularBase& other, double f) const noexcept;
81+
7882
[[nodiscard]]
7983
Float2 toFloat2() const noexcept;
8084

Siv3D/include/Siv3D/detail/Circular.ipp

+6
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ namespace s3d
8383
return *this;
8484
}
8585

86+
template<class Float, int32 Oclock>
87+
inline CircularBase<Float, Oclock> CircularBase<Float, Oclock>::lerp(const CircularBase& other, double f) const noexcept
88+
{
89+
return CircularBase{ Math::Lerp(r, other.r, f), Math::LerpAngle(theta, other.theta, f) };
90+
}
91+
8692
template <class Float, int32 Oclock>
8793
inline Float2 CircularBase<Float, Oclock>::toFloat2() const noexcept
8894
{

0 commit comments

Comments
 (0)