From f1c70c756ebfd58864acbbede234e62d93cc741d Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 20 Sep 2024 14:40:03 +0200 Subject: [PATCH] Fix unit tests --- Angle.cpp | 3 ++- Angle.h | 4 +++- CMakeLists.txt | 1 + Direction.cpp | 1 - SwingTwist.cpp | 2 -- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Angle.cpp b/Angle.cpp index ebc689d..7f80414 100644 --- a/Angle.cpp +++ b/Angle.cpp @@ -73,7 +73,7 @@ float Angle::SineRuleAngle(float a, float beta, float b) { //---------------------- template <> -AngleOf::AngleOf(int angle) : value((float)angle) {} +AngleOf::AngleOf(signed int angle) : value((float)angle) {} template <> AngleOf::AngleOf(float angle) : value(angle) {} @@ -83,6 +83,7 @@ AngleOf AngleOf::Degrees(float a) { AngleOf angle = AngleOf(a); return angle; } + template AngleOf AngleOf::Radians(float a) { AngleOf angle = AngleOf((a / pi) * 180); diff --git a/Angle.h b/Angle.h index 7befc46..073d97a 100644 --- a/Angle.h +++ b/Angle.h @@ -17,7 +17,9 @@ template class AngleOf { public: AngleOf() {}; - AngleOf(int f); + // These are deprecated, will move to private. + // Use Degrees/Radians instead + AngleOf(signed int f); AngleOf(float f); static AngleOf Degrees(float f); diff --git a/CMakeLists.txt b/CMakeLists.txt index cc51cb9..ef13b2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ else() "Matrix.cpp" "Axis.cpp" "AngleAxis.cpp" + "SwingTwist.cpp" "Direction.cpp" ) diff --git a/Direction.cpp b/Direction.cpp index ae5b503..0b77fe5 100644 --- a/Direction.cpp +++ b/Direction.cpp @@ -73,4 +73,3 @@ Vector3 DirectionOf::ToVector3() { template class DirectionOf; template class DirectionOf; -template class DirectionOf; \ No newline at end of file diff --git a/SwingTwist.cpp b/SwingTwist.cpp index 7899631..0d10a16 100644 --- a/SwingTwist.cpp +++ b/SwingTwist.cpp @@ -6,8 +6,6 @@ template SwingTwistOf::SwingTwistOf() { - // this->horizontal = AngleOf(0); - // this->vertical = AngleOf(0); this->swing = DirectionOf(0, 0); this->twist = AngleOf(0); }