X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=libs%2Fcgmath%2Fcgmmisc.inl;h=0def7274810db70d1fc4b79cdec3a89b0d8e638d;hb=HEAD;hp=a3cdfb5da9f640aeb9390b5b27bb90e8802fbb0a;hpb=15a4548ff09afb37dd33786cafd50b060a64f840;p=retroray diff --git a/libs/cgmath/cgmmisc.inl b/libs/cgmath/cgmmisc.inl index a3cdfb5..0def727 100644 --- a/libs/cgmath/cgmmisc.inl +++ b/libs/cgmath/cgmmisc.inl @@ -10,12 +10,12 @@ static CGM_INLINE float cgm_deg_to_rad(float deg) { - return M_PI * deg / 180.0f; + return CGM_PI * deg / 180.0f; } static CGM_INLINE float cgm_rad_to_deg(float rad) { - return 180.0f * rad / M_PI; + return 180.0f * rad / CGM_PI; } static CGM_INLINE float cgm_smoothstep(float a, float b, float x) @@ -87,7 +87,7 @@ static CGM_INLINE float cgm_spline(float a, float b, float c, float d, float t) static CGM_INLINE void cgm_discrand(cgm_vec3 *pt, float rad) { - float theta = 2.0f * M_PI * (float)rand() / RAND_MAX; + float theta = 2.0f * CGM_PI * (float)rand() / RAND_MAX; float r = sqrt((float)rand() / RAND_MAX) * rad; pt->x = cos(theta) * r; pt->y = sin(theta) * r; @@ -101,7 +101,7 @@ static CGM_INLINE void cgm_sphrand(cgm_vec3 *pt, float rad) u = (float)rand() / RAND_MAX; v = (float)rand() / RAND_MAX; - theta = 2.0f * M_PI * u; + theta = 2.0f * CGM_PI * u; phi = acos(2.0f * v - 1.0f); pt->x = cos(theta) * sin(phi) * rad;