optimized function's name that they are deg2rad and rad2deg

This commit is contained in:
2022-01-26 10:57:18 +08:00
parent 6280ace5a5
commit 14da094013
2 changed files with 4 additions and 4 deletions

View File

@@ -46,15 +46,15 @@ namespace hgl
/** /**
* 角度转弧度 * 角度转弧度
*/ */
inline double hgl_deg2rad(const double ang) inline double deg2rad(const double deg)
{ {
return ang*(HGL_PI/180.0f); return deg*(HGL_PI/180.0f);
} }
/** /**
* 弧度转角度 * 弧度转角度
*/ */
inline double hgl_rad2deg(const double rad) inline double rad2deg(const double rad)
{ {
return rad*(180.0f/HGL_PI); return rad*(180.0f/HGL_PI);
} }

View File

@@ -78,7 +78,7 @@ namespace hgl
float znear, float znear,
float zfar) float zfar)
{ {
float f = 1.0f / tan( hgl_deg2rad( 0.5f * field_of_view ) ); float f = 1.0f / tan( deg2rad( 0.5f * field_of_view ) );
return Matrix4f( return Matrix4f(
f / aspect_ratio, f / aspect_ratio,