Ver Fonte

Merge branch 'master' of github.com:libigl/libigl

Former-commit-id: 8d910fa53269206c1fd1485896330af81aeae6c3
Alec Jacobson há 10 anos atrás
pai
commit
e53df56ce3
3 ficheiros alterados com 7 adições e 2 exclusões
  1. 1 1
      build/Makefile.conf
  2. 5 1
      include/igl/angles.cpp
  3. 1 0
      tutorial/cmake/FindGLEW.cmake

+ 1 - 1
build/Makefile.conf

@@ -107,7 +107,7 @@ endif
 ifeq ($(IGL_USERNAME),daniele)
 	IGL_WITH_MATLAB=0
 	AFLAGS=-m64
-	GG=g++-4.7
+	GG=g++-4.8
 	EIGEN3_INC=-I/usr/local/include/eigen3
 endif
 

+ 5 - 1
include/igl/angles.cpp

@@ -24,7 +24,11 @@ void igl::angles(
     Eigen::RowVector3d v1 = (x-y).normalized();
     Eigen::RowVector3d v2 = (z-y).normalized();
 
-    return acos(v1 * v2.transpose());
+    // http://stackoverflow.com/questions/10133957/signed-angle-between-two-vectors-without-a-reference-plane
+    double s = v1.cross(v2).norm();
+    double c = v1.dot(v2);
+
+    return atan2(s, c);
   };
 
   for(unsigned i=0; i<F.rows(); ++i)

+ 1 - 0
tutorial/cmake/FindGLEW.cmake

@@ -7,6 +7,7 @@
 
 FIND_PATH(GLEW_INCLUDE_DIR GL/glew.h
    ${PROJECT_SOURCE_DIR}/../../external/glew/include
+   ${PROJECT_SOURCE_DIR}/../external/glew/include
    /usr/include
    /usr/local/include
    $ENV{GLEWROOT}/include