Przeglądaj źródła

Use igl::PI instead of M_PI to fix VS math error

See https://github.com/libigl/libigl/issues/524


Former-commit-id: e6ea7f4888da7b1fb8c4a6ca299da2a8ab15c3c1
Patrik Huber 8 lat temu
rodzic
commit
3c9dde4a3c
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      include/igl/viewer/ViewerCore.cpp

+ 3 - 2
include/igl/viewer/ViewerCore.cpp

@@ -14,6 +14,7 @@
 #include <igl/ortho.h>
 #include <igl/massmatrix.h>
 #include <igl/barycenter.h>
+#include <igl/PI.h>
 #include <Eigen/Geometry>
 #include <iostream>
 
@@ -135,12 +136,12 @@ IGL_INLINE void igl::viewer::ViewerCore::draw(
     if (orthographic)
     {
       float length = (camera_eye - camera_center).norm();
-      float h = tan(camera_view_angle/360.0 * M_PI) * (length);
+      float h = tan(camera_view_angle/360.0 * igl::PI) * (length);
       ortho(-h*width/height, h*width/height, -h, h, camera_dnear, camera_dfar,proj);
     }
     else
     {
-      float fH = tan(camera_view_angle / 360.0 * M_PI) * camera_dnear;
+      float fH = tan(camera_view_angle / 360.0 * igl::PI) * camera_dnear;
       float fW = fH * (double)width/(double)height;
       frustum(-fW, fW, -fH, fH, camera_dnear, camera_dfar,proj);
     }