From 8e9a14c7d6a880179bf82a5b736b967102dbc23e Mon Sep 17 00:00:00 2001 From: LucileRemigy <45563869+LucileRemigy@users.noreply.github.com> Date: Thu, 5 Dec 2019 09:07:39 +0100 Subject: [PATCH] Fix compilation warning (#111) --- include/hpp/fcl/collision_object.h | 6 +++--- include/hpp/fcl/internal/traversal_node_octree.h | 8 ++++---- include/hpp/fcl/profile.h | 4 ++-- src/narrowphase/details.h | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/hpp/fcl/collision_object.h b/include/hpp/fcl/collision_object.h index 31fc86d8..91c149b9 100644 --- a/include/hpp/fcl/collision_object.h +++ b/include/hpp/fcl/collision_object.h @@ -93,15 +93,15 @@ public: } /// @brief whether the object is completely occupied - inline bool isOccupied() const HPP_FCL_DEPRECATED + inline bool isOccupied() const { return cost_density >= threshold_occupied; } /// @brief whether the object is completely free - inline bool isFree() const HPP_FCL_DEPRECATED + inline bool isFree() const { return cost_density <= threshold_free; } /// @brief whether the object has some uncertainty - bool isUncertain() const HPP_FCL_DEPRECATED; + bool isUncertain() const; /// @brief AABB center in local coordinate Vec3f aabb_center; diff --git a/include/hpp/fcl/internal/traversal_node_octree.h b/include/hpp/fcl/internal/traversal_node_octree.h index e2857da2..7ece5fd0 100644 --- a/include/hpp/fcl/internal/traversal_node_octree.h +++ b/include/hpp/fcl/internal/traversal_node_octree.h @@ -333,7 +333,7 @@ private: if(solver->shapeIntersect(box, box_tf, s, tf2, NULL, NULL, NULL)) { if(cresult->numContacts() < crequest->num_max_contacts) - cresult->addContact(Contact(tree1, &s, root1 - tree1->getRoot(), Contact::NONE)); + cresult->addContact(Contact(tree1, &s, static_cast<int>(root1 - tree1->getRoot()), Contact::NONE)); } } else @@ -345,7 +345,7 @@ private: if(solver->shapeIntersect(box, box_tf, s, tf2, &contact, &depth, &normal)) { if(cresult->numContacts() < crequest->num_max_contacts) - cresult->addContact(Contact(tree1, &s, root1 - tree1->getRoot(), Contact::NONE, contact, normal, depth)); + cresult->addContact(Contact(tree1, &s, static_cast<int>(root1 - tree1->getRoot()), Contact::NONE, contact, normal, depth)); } } @@ -808,7 +808,7 @@ private: if(obb1.overlap(obb2)) { if(cresult->numContacts() < crequest->num_max_contacts) - cresult->addContact(Contact(tree1, tree2, root1 - tree1->getRoot(), root2 - tree2->getRoot())); + cresult->addContact(Contact(tree1, tree2, static_cast<int>(root1 - tree1->getRoot()), static_cast<int>(root2 - tree2->getRoot()))); } } else @@ -824,7 +824,7 @@ private: if(solver->shapeIntersect(box1, box1_tf, box2, box2_tf, &contact, &depth, &normal)) { if(cresult->numContacts() < crequest->num_max_contacts) - cresult->addContact(Contact(tree1, tree2, root1 - tree1->getRoot(), root2 - tree2->getRoot(), contact, normal, depth)); + cresult->addContact(Contact(tree1, tree2, static_cast<int>(root1 - tree1->getRoot()), static_cast<int>(root2 - tree2->getRoot()), contact, normal, depth)); } } diff --git a/include/hpp/fcl/profile.h b/include/hpp/fcl/profile.h index a7e3f278..497a0a44 100644 --- a/include/hpp/fcl/profile.h +++ b/include/hpp/fcl/profile.h @@ -86,8 +86,8 @@ inline point now(void) /// @brief Return the time duration representing a given number of seconds inline duration seconds(double sec) { - long s = (long)sec; - long us = (long)((sec - s) * 1000000); + long int s = static_cast<long int>(sec); + long int us = ((static_cast<long int>(sec) - s) * 1000000); return boost::posix_time::seconds(s) + boost::posix_time::microseconds(us); } diff --git a/src/narrowphase/details.h b/src/narrowphase/details.h index 58036184..7c4efa3f 100644 --- a/src/narrowphase/details.h +++ b/src/narrowphase/details.h @@ -151,6 +151,7 @@ namespace fcl { Vec3f S (tf1.getTranslation ()); // axis of the cylinder Vec3f u (tf2.getRotation ().col (2)); + /// @todo a tiny performance improvement could be achieved using the abscissa with S as the origin assert ((B - A - (s2.halfLength * 2) * u).norm () < eps); Vec3f AS (S - A); // abscissa of S on cylinder axis with A as the origin -- GitLab