From b7abd246481e1e9a9202e83a33622cd08dc1450b Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <josephmirabel@gmail.com> Date: Sun, 12 Jun 2016 20:12:29 +0200 Subject: [PATCH] WIP: Add some eval --- include/hpp/fcl/math/transform.h | 4 ++-- include/hpp/fcl/shape/geometric_shape_to_BVH_model.h | 2 +- src/traversal/traversal_node_bvhs.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hpp/fcl/math/transform.h b/include/hpp/fcl/math/transform.h index e26c1a77..3eba2726 100644 --- a/include/hpp/fcl/math/transform.h +++ b/include/hpp/fcl/math/transform.h @@ -409,7 +409,7 @@ public: { matrix_set = false; q.conj(); - T = q.transform(-T); + T = q.transform(-T).eval(); return *this; } @@ -424,7 +424,7 @@ public: inline const Transform3f& operator *= (const Transform3f& other) { matrix_set = false; - T = q.transform(other.T) + T; + T += q.transform(other.T).eval(); q *= other.q; return *this; } diff --git a/include/hpp/fcl/shape/geometric_shape_to_BVH_model.h b/include/hpp/fcl/shape/geometric_shape_to_BVH_model.h index 9e97491f..2784abdc 100644 --- a/include/hpp/fcl/shape/geometric_shape_to_BVH_model.h +++ b/include/hpp/fcl/shape/geometric_shape_to_BVH_model.h @@ -79,7 +79,7 @@ void generateBVHModel(BVHModel<BV>& model, const Box& shape, const Transform3f& for(unsigned int i = 0; i < points.size(); ++i) { - points[i] = pose.transform(points[i]); + points[i] = pose.transform(points[i]).eval(); } model.beginModel(); diff --git a/src/traversal/traversal_node_bvhs.cpp b/src/traversal/traversal_node_bvhs.cpp index 5682606c..06b14052 100644 --- a/src/traversal/traversal_node_bvhs.cpp +++ b/src/traversal/traversal_node_bvhs.cpp @@ -354,8 +354,8 @@ static inline void distancePostprocessOrientedNode(const BVHModel<BV>* model1, c /// the points obtained by triDistance are not in world space: both are in object1's local coordinate system, so we need to convert them into the world space. if(request.enable_nearest_points && (result.o1 == model1) && (result.o2 == model2)) { - result.nearest_points[0] = tf1.transform(result.nearest_points[0]); - result.nearest_points[1] = tf1.transform(result.nearest_points[1]); + result.nearest_points[0] = tf1.transform(result.nearest_points[0]).eval(); + result.nearest_points[1] = tf1.transform(result.nearest_points[1]).eval(); } } @@ -492,7 +492,7 @@ bool meshConservativeAdvancementOrientedNodeCanStop(FCL_REAL c, Vec3f n_transformed (getBVAxes(model1->getBV(c1).bv) * n); Quaternion3f R0; motion1->getCurrentRotation(R0); - n_transformed = R0.transform(n_transformed); + n_transformed = R0.transform(n_transformed).eval(); n_transformed.normalize(); TBVMotionBoundVisitor<BV> mb_visitor1(model1->getBV(c1).bv, n_transformed), mb_visitor2(model2->getBV(c2).bv, -n_transformed); -- GitLab