diff --git a/include/Nazara/Math/Angle.hpp b/include/Nazara/Math/Angle.hpp index 64e7ad878..2656477e6 100644 --- a/include/Nazara/Math/Angle.hpp +++ b/include/Nazara/Math/Angle.hpp @@ -27,8 +27,9 @@ namespace Nz public: Angle() = default; Angle(T angle); + Angle(const Angle& angle); + Angle(const Angle& angle); template explicit Angle(const Angle& Angle); - Angle(const Angle&) = default; ~Angle() = default; T GetCos() const; @@ -51,9 +52,6 @@ namespace Nz Angle ToRadianAngle() const; String ToString() const; - template> operator Angle() const { return ToDegreeAngle(); } // GCC < 8 bug - template> operator Angle() const { return ToRadianAngle(); } // GCC < 8 bug - Angle& operator=(const Angle&) = default; Angle operator+(const Angle& other) const; diff --git a/include/Nazara/Math/Angle.inl b/include/Nazara/Math/Angle.inl index cb3a237c2..93acb14c8 100644 --- a/include/Nazara/Math/Angle.inl +++ b/include/Nazara/Math/Angle.inl @@ -155,6 +155,28 @@ namespace Nz { } + /*! + * \brief Constructs an Angle object from a angle in degrees, converting if required + * + * \param value Angle object to copy + */ + template + Angle::Angle(const Angle& angle) : + value(Detail::AngleUtils::FromDegrees(angle.value)) + { + } + + /*! + * \brief Constructs an Angle object from a angle in radians, converting if required + * + * \param value Angle object to copy + */ + template + Angle::Angle(const Angle& angle) : + value(Detail::AngleUtils::FromRadians(angle.value)) + { + } + /*! * \brief Computes the cosine of the angle * \return Cosine of angle