ソースを参照

Fix segment_segment_intersect code not templated

KarlLeell 6 年 前
コミット
9d2ed3d718
1 ファイル変更3 行追加3 行削除
  1. 3 3
      include/igl/segment_segment_intersect.cpp

+ 3 - 3
include/igl/segment_segment_intersect.cpp

@@ -30,7 +30,7 @@ IGL_INLINE bool igl::segment_segment_intersect(
   // t = (q - p) x s / (r x s)
 
   // (r x s) ~ 0 --> directions are parallel, they will never cross
-  Eigen::RowVector3d rxs = r.cross(s);
+  Eigen::Matrix<typename DerivedDir::Scalar, 1, 3> rxs = r.cross(s);
   if (rxs.norm() <= eps)
     return false;
 
@@ -38,14 +38,14 @@ IGL_INLINE bool igl::segment_segment_intersect(
 
   double u;
   // u = (q − p) × r / (r × s)
-  Eigen::RowVector3d u1 = (q - p).cross(r);
+  Eigen::Matrix<typename DerivedDir::Scalar, 1, 3> u1 = (q - p).cross(r);
   sign = ((u1.dot(rxs)) > 0) ? 1 : -1;
   u = u1.norm() / rxs.norm();
   u = u * sign;
 
   double t;
   // t = (q - p) x s / (r x s)
-  Eigen::RowVector3d t1 = (q - p).cross(s);
+  Eigen::Matrix<typename DerivedDir::Scalar, 1, 3> t1 = (q - p).cross(s);
   sign = ((t1.dot(rxs)) > 0) ? 1 : -1;
   t = t1.norm() / rxs.norm();
   t = t * sign;