From 9e7753802eeb4c249769919004b360d436e535ec Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <josephmirabel@gmail.com>
Date: Sun, 12 Jun 2016 20:11:55 +0200
Subject: [PATCH] Transform3f returns an Eigen expression

---
 include/hpp/fcl/math/transform.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/hpp/fcl/math/transform.h b/include/hpp/fcl/math/transform.h
index bd5d6d80..e26c1a77 100644
--- a/include/hpp/fcl/math/transform.h
+++ b/include/hpp/fcl/math/transform.h
@@ -254,6 +254,14 @@ static inline std::ostream& operator << (std::ostream& o, const Quaternion3f& q)
 /// @brief Simple transform class used locally by InterpMotion
 class Transform3f
 {
+  template<typename Derived> struct transform_return_type {
+    typedef Eigen::CwiseBinaryOp <
+      Eigen::internal::scalar_sum_op <FCL_REAL>,
+      const typename Quaternion3f::transform_return_type<Derived>::Type,
+      const Vec3f >
+      Type;
+  };
+
   boost::mutex lock_;
 
   /// @brief Whether matrix cache is set
@@ -390,7 +398,7 @@ public:
 
   /// @brief transform a given vector by the transform
   template <typename Derived>
-  inline Vec3f transform(const Eigen::MatrixBase<Derived>& v) const
+  inline typename transform_return_type<Derived>::Type transform(const Eigen::MatrixBase<Derived>& v) const
   {
     EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived, 3);
     return q.transform(v) + T;
-- 
GitLab