修正没有使用浮点值做rad2deg/deg2rad计算的问题
This commit is contained in:
@@ -82,19 +82,17 @@ namespace hgl
|
|||||||
/**
|
/**
|
||||||
* 角度转弧度
|
* 角度转弧度
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
inline constexpr float deg2rad(const float deg)
|
||||||
inline constexpr T deg2rad(const T deg)
|
|
||||||
{
|
{
|
||||||
return T(deg*(HGL_PI/180.0f));
|
return deg*(HGL_PI/180.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 弧度转角度
|
* 弧度转角度
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
inline constexpr double rad2deg(const float rad)
|
||||||
inline constexpr T rad2deg(const T rad)
|
|
||||||
{
|
{
|
||||||
return T(rad*(180.0f/HGL_PI));
|
return rad*(180.0f/HGL_PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user