@@ -1154,14 +1154,14 @@ void ofMesh_<V,N,C,T>::load(const of::filesystem::path& path){
11541154
11551155 if ((state==Header || state==FaceDef) && lineStr.find (" element vertex" )==0 ){
11561156 state = VertexDef;
1157- orderVertices = MAX (orderIndices, 0 )+1 ;
1157+ orderVertices = std::max (orderIndices, 0 )+1 ;
11581158 data.getVertices ().resize (ofTo<size_t >(lineStr.substr (15 )));
11591159 continue ;
11601160 }
11611161
11621162 if ((state==Header || state==VertexDef) && lineStr.find (" element face" )==0 ){
11631163 state = FaceDef;
1164- orderIndices = MAX (orderVertices, 0 )+1 ;
1164+ orderIndices = std::max (orderVertices, 0 )+1 ;
11651165 data.getIndices ().resize (ofTo<size_t >(lineStr.substr (13 ))*3 );
11661166 continue ;
11671167 }
@@ -1840,7 +1840,7 @@ void ofMesh_<V,N,C,T>::smoothNormals( float angle ) {
18401840
18411841 V vert;
18421842 N normal;
1843- float angleCos = cos (angle * DEG_TO_RAD );
1843+ float angleCos = cos (ofDegToRad ( angle) );
18441844 float numNormals=0 ;
18451845
18461846 for (ofIndexType j = 0 ; j < triangles.size (); j++) {
@@ -2006,8 +2006,8 @@ ofMesh_<V,N,C,T> ofMesh_<V,N,C,T>::sphere( float radius, int res, ofPrimitiveMod
20062006 ofMesh_<V,N,C,T> mesh;
20072007
20082008 float doubleRes = res*2 .f ;
2009- float polarInc = PI /(res); // ringAngle
2010- float azimInc = TWO_PI /(doubleRes); // segAngle //
2009+ float polarInc = glm::pi< float >() /(res); // ringAngle
2010+ float azimInc = glm::two_pi< float >() /(doubleRes); // segAngle //
20112011
20122012 if (mode != OF_PRIMITIVE_TRIANGLE_STRIP && mode != OF_PRIMITIVE_TRIANGLES) {
20132013 mode = OF_PRIMITIVE_TRIANGLE_STRIP;
@@ -2019,8 +2019,8 @@ ofMesh_<V,N,C,T> ofMesh_<V,N,C,T>::sphere( float radius, int res, ofPrimitiveMod
20192019
20202020 for (float i = 0 ; i < res+1 ; i++) {
20212021
2022- float tr = sin ( PI -i * polarInc );
2023- float ny = cos ( PI -i * polarInc );
2022+ float tr = sin ( glm::pi< float >() -i * polarInc );
2023+ float ny = cos ( glm::pi< float >() -i * polarInc );
20242024
20252025 tcoord.y = 1 .f - (i / res);
20262026
@@ -2228,8 +2228,8 @@ ofMesh_<V,N,C,T> ofMesh_<V,N,C,T>::icosphere(float radius, std::size_t iteration
22282228 float r0 = sqrtf (vec.x *vec.x +vec.z *vec.z );
22292229 float alpha;
22302230 alpha = atan2f (vec.z ,vec.x );
2231- u = alpha/TWO_PI +.5f ;
2232- v = atan2f (vec.y , r0)/PI + .5f ;
2231+ u = alpha/glm::two_pi< float >() +.5f ;
2232+ v = atan2f (vec.y , r0)/glm::pi< float >() + .5f ;
22332233 // reverse the u coord, so the default is texture mapped left to
22342234 // right on the outside of a sphere
22352235 // reverse the v coord, so that texture origin is at top left
@@ -2338,7 +2338,7 @@ ofMesh_<V,N,C,T> ofMesh_<V,N,C,T>::cylinder( float radius, float height, int rad
23382338 if ( capSegs < 2 ) bCapped = false ;
23392339 if (!bCapped) capSegs=1 ;
23402340
2341- float angleIncRadius = -1 * (TWO_PI /((float )radiusSegments-1 .f ));
2341+ float angleIncRadius = -1 * (glm::two_pi< float >() /((float )radiusSegments-1 .f ));
23422342 float heightInc = height/((float )heightSegments-1 .f );
23432343 float halfH = height*.5f ;
23442344
@@ -2533,7 +2533,7 @@ ofMesh_<V,N,C,T> ofMesh_<V,N,C,T>::cone( float radius, float height, int radiusS
25332533 }
25342534
25352535
2536- float angleIncRadius = -1 .f * ((TWO_PI /((float )radiusSegments-1 .f )));
2536+ float angleIncRadius = -1 .f * ((glm::two_pi< float >() /((float )radiusSegments-1 .f )));
25372537 float heightInc = height/((float )heightSegments-1 );
25382538 float halfH = height*.5f ;
25392539
0 commit comments