Trying to fix specialization before instantiation error
This commit is contained in:
parent
b877d4d2f3
commit
f47e504bf4
22
Angle.cpp
22
Angle.cpp
@ -9,17 +9,6 @@
|
|||||||
const float Rad2Deg = 57.29578F;
|
const float Rad2Deg = 57.29578F;
|
||||||
const float Deg2Rad = 0.0174532924F;
|
const float Deg2Rad = 0.0174532924F;
|
||||||
|
|
||||||
template <> AngleOf<float> AngleOf<float>::Degrees(float degrees) {
|
|
||||||
if (isfinite(degrees)) {
|
|
||||||
while (degrees < -180)
|
|
||||||
degrees += 360;
|
|
||||||
while (degrees >= 180)
|
|
||||||
degrees -= 360;
|
|
||||||
}
|
|
||||||
|
|
||||||
return AngleOf<float>(degrees);
|
|
||||||
}
|
|
||||||
|
|
||||||
//===== Generic
|
//===== Generic
|
||||||
|
|
||||||
template <typename T> AngleOf<T>::AngleOf() : value(0) {}
|
template <typename T> AngleOf<T>::AngleOf() : value(0) {}
|
||||||
@ -285,6 +274,17 @@ template class AngleOf<signed short>;
|
|||||||
|
|
||||||
//===== AngleSingle, AngleOf<float>
|
//===== AngleSingle, AngleOf<float>
|
||||||
|
|
||||||
|
template <> AngleOf<float> AngleOf<float>::Degrees(float degrees) {
|
||||||
|
if (isfinite(degrees)) {
|
||||||
|
while (degrees < -180)
|
||||||
|
degrees += 360;
|
||||||
|
while (degrees >= 180)
|
||||||
|
degrees -= 360;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AngleOf<float>(degrees);
|
||||||
|
}
|
||||||
|
|
||||||
template <> AngleOf<float> AngleOf<float>::Radians(float radians) {
|
template <> AngleOf<float> AngleOf<float>::Radians(float radians) {
|
||||||
if (isfinite(radians)) {
|
if (isfinite(radians)) {
|
||||||
while (radians <= -pi)
|
while (radians <= -pi)
|
||||||
|
2
Angle.h
2
Angle.h
@ -28,12 +28,12 @@ public:
|
|||||||
// const static AngleOf<T> deg90;
|
// const static AngleOf<T> deg90;
|
||||||
// const static AngleOf<T> deg180;
|
// const static AngleOf<T> deg180;
|
||||||
|
|
||||||
|
constexpr static auto Deg = Degrees;
|
||||||
/// @brief Creates an angle in degrees
|
/// @brief Creates an angle in degrees
|
||||||
/// @param degrees the angle in degrees
|
/// @param degrees the angle in degrees
|
||||||
/// @return The angle value
|
/// @return The angle value
|
||||||
static AngleOf<T> Degrees(float degrees);
|
static AngleOf<T> Degrees(float degrees);
|
||||||
/// @brief Short-hand Deg alias for the Degrees function
|
/// @brief Short-hand Deg alias for the Degrees function
|
||||||
// constexpr static auto Deg = Degrees;
|
|
||||||
/// @brief Creates an angle in radians
|
/// @brief Creates an angle in radians
|
||||||
/// @param radians the angle in radians
|
/// @param radians the angle in radians
|
||||||
/// @return The angle value
|
/// @return The angle value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user