浏览代码

removed transpose from procrustes (to check)
added missing includes


Former-commit-id: a28c1fcd33e2917b00bb6ef97cbfcee539b07cf4

Olga Diamanti 10 年之前
父节点
当前提交
1f1e1b721b

+ 3 - 0
include/igl/embree/EmbreeIntersector.h

@@ -17,10 +17,13 @@
 #define IGL_EMBREE_INTERSECTOR_H
 #define IGL_EMBREE_INTERSECTOR_H
 
 
 #include <Eigen/Core>
 #include <Eigen/Core>
+#include <Eigen/Geometry>
+
 #include <vector>
 #include <vector>
 #include <embree2/rtcore.h>
 #include <embree2/rtcore.h>
 #include <embree2/rtcore_ray.h>
 #include <embree2/rtcore_ray.h>
 #include "Hit.h"
 #include "Hit.h"
+#include <iostream>
 
 
 namespace igl
 namespace igl
 {
 {

+ 1 - 1
include/igl/procrustes.cpp

@@ -55,7 +55,7 @@ IGL_INLINE void igl::procrustes(
   {
   {
     polar_svd(S,R,T);
     polar_svd(S,R,T);
   }
   }
-  R.transposeInPlace();
+//  R.transposeInPlace();
 
 
   // Translation
   // Translation
   t = Ymean - scale*R.transpose()*Xmean;
   t = Ymean - scale*R.transpose()*Xmean;

+ 4 - 3
include/igl/rotation_matrix_from_directions.cpp

@@ -15,15 +15,16 @@ IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(cons
                                                                         bool normalized)
                                                                         bool normalized)
 {
 {
   Eigen::Matrix<Scalar, 3, 3> rotM;
   Eigen::Matrix<Scalar, 3, 3> rotM;
-  const double epsilon=0.00001;
+  const double epsilon=1e-8;
   // if (!normalized)
   // if (!normalized)
-  // {
+//   {
     // v0.normalize();
     // v0.normalize();
     // v1.normalize();
     // v1.normalize();
   // }
   // }
   Scalar dot=v0.normalized().dot(v1.normalized());
   Scalar dot=v0.normalized().dot(v1.normalized());
   ///control if there is no rotation
   ///control if there is no rotation
-  if (dot>((double)1-epsilon))
+//  if (dot>((double)1-epsilon))
+  if ((v0-v1).norm()<epsilon)
   {
   {
     rotM = Eigen::Matrix<Scalar, 3, 3>::Identity();
     rotM = Eigen::Matrix<Scalar, 3, 3>::Identity();
     return rotM;
     return rotM;

+ 1 - 0
include/igl/viewer/ViewerPlugin.h

@@ -16,6 +16,7 @@
 #define IGL_VIEWER_PLUGIN_H
 #define IGL_VIEWER_PLUGIN_H
 #include <string>
 #include <string>
 #include <igl/igl_inline.h>
 #include <igl/igl_inline.h>
+#include <vector>
 
 
 namespace igl
 namespace igl
 {
 {

+ 14 - 14
include/igl/xml/old_version/XMLSerialization.h

@@ -4,23 +4,23 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
- ------------------------------------------------------------------------------
- Inherit from this class to have the easiest way to serialize your user defined class.
- 
- 1) Pass the default name of your class to the base constructor.
- 2) Override InitSerialization() and add your variables to serialize like:
- xmlSerializer->Add(var1,"name1");
- xmlSerializer->Add(var2,"name2");
-
- Workaround for Visual Studio run time debugger inspection problem:
- Copy and implement all the functions, splitting them into a source and header file.
- Restrictions on Native C++ Expressions (Anonymous Namespaces):
- http://msdn.microsoft.com/en-us/library/0888kc6a%28VS.80%29.aspx
- ----------------------------------------------------------------------------*/
+// ------------------------------------------------------------------------------
+// Inherit from this class to have the easiest way to serialize your user defined class.
+// 
+// 1) Pass the default name of your class to the base constructor.
+// 2) Override InitSerialization() and add your variables to serialize like:
+// xmlSerializer->Add(var1,"name1");
+// xmlSerializer->Add(var2,"name2");
+//
+// Workaround for Visual Studio run time debugger inspection problem:
+// Copy and implement all the functions, splitting them into a source and header file.
+// Restrictions on Native C++ Expressions (Anonymous Namespaces):
+// http://msdn.microsoft.com/en-us/library/0888kc6a%28VS.80%29.aspx
+// ----------------------------------------------------------------------------*/
 #ifndef IGL_XML_SERIALIZATION_H
 #ifndef IGL_XML_SERIALIZATION_H
 #define IGL_XML_SERIALIZATION_H
 #define IGL_XML_SERIALIZATION_H
 
 
-#include <igl/xml/XMLSerializer.h>
+#include <igl/xml/old_version/XMLSerializer.h>
 
 
 namespace igl
 namespace igl
 {
 {