Эх сурвалжийг харах

fix style, rm unused parameter

Former-commit-id: 51b19849e2742e6979b03d68ea39b756d96b5310
Alec Jacobson 9 жил өмнө
parent
commit
2d42198b19

+ 4 - 10
include/igl/rotation_matrix_from_directions.cpp

@@ -11,20 +11,14 @@
 #include <iostream>
 
 template <typename Scalar>
-IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(const Eigen::Matrix<Scalar, 3, 1> v0,
-                                                                        const Eigen::Matrix<Scalar, 3, 1> v1,
-                                                                        bool normalized)
+IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(
+  const Eigen::Matrix<Scalar, 3, 1> v0,
+  const Eigen::Matrix<Scalar, 3, 1> v1)
 {
   Eigen::Matrix<Scalar, 3, 3> rotM;
   const double epsilon=1e-8;
-  // if (!normalized)
-//   {
-    // v0.normalize();
-    // v1.normalize();
-  // }
   Scalar dot=v0.normalized().dot(v1.normalized());
   ///control if there is no rotation
-//  if (dot>((double)1-epsilon))
   if ((v0-v1).norm()<epsilon)
   {
     rotM = Eigen::Matrix<Scalar, 3, 3>::Identity();
@@ -65,5 +59,5 @@ IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(cons
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
-template Eigen::Matrix<double, 3, 3, 0, 3, 3> igl::rotation_matrix_from_directions<double>(const Eigen::Matrix<double, 3, 1, 0, 3, 1>, const Eigen::Matrix<double, 3, 1, 0, 3, 1>, const bool);
+template Eigen::Matrix<double, 3, 3, 0, 3, 3> igl::rotation_matrix_from_directions<double>(const Eigen::Matrix<double, 3, 1, 0, 3, 1>, const Eigen::Matrix<double, 3, 1, 0, 3, 1>);
 #endif

+ 15 - 17
include/igl/rotation_matrix_from_directions.h

@@ -1,36 +1,34 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 //
-// Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@gmail.com>, Olga Diamanti <olga.diam@gmail.com>
+// Copyright (C) 2016 Alec Jacobson, Daniele Panozzo, Olga Diamanti 
 //
 // 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
 // obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_ROTATION_MATRIX_FROM_DIRECTIONS
-#define IGL_ROTATION_MATRIX_FROM_DIRECTIONS
+#ifndef IGL_ROTATION_MATRIX_FROM_DIRECTIONS_H
+#define IGL_ROTATION_MATRIX_FROM_DIRECTIONS_H
 #include "igl_inline.h"
 
 #include <Eigen/Core>
 
-namespace igl {
-  /// Given 2 vectors centered on origin calculate the rotation matrix from first to the second
-
+namespace igl 
+{
+  // Given 2 vectors centered on origin calculate the rotation matrix from
+  // first to the second
+  //
   // Inputs:
-  //   v0, v1         the two #3 by 1 vectors
-  //   normalized     boolean, if false, then the vectors are normalized prior to the calculation
+  //   v0  3D column vector
+  //   v1  3D column vector
   // Output:
-  //                  3 by 3 rotation matrix that takes v0 to v1
+  //   3 by 3 rotation matrix that takes v0 to v1
   //
   template <typename Scalar>
-  IGL_INLINE Eigen::Matrix<Scalar, 3, 3> rotation_matrix_from_directions(const Eigen::Matrix<Scalar, 3, 1> v0,
-                                                                     const Eigen::Matrix<Scalar, 3, 1> v1,
-                                                                     const bool normalized=true);
+  IGL_INLINE Eigen::Matrix<Scalar, 3, 3> rotation_matrix_from_directions(
+    const Eigen::Matrix<Scalar, 3, 1> v0,
+    const Eigen::Matrix<Scalar, 3, 1> v1);
 }
 
-
 #ifndef IGL_STATIC_LIBRARY
 #include "rotation_matrix_from_directions.cpp"
 #endif
-
-
-#endif /* defined(IGL_ROTATION_MATRIX_FROM_DIRECTIONS) */
+#endif