From 7afe483a5f40dee24a01e43b60ca67e33a633f7a Mon Sep 17 00:00:00 2001 From: Tobias Kunz <tobias@gatech.edu> Date: Tue, 7 May 2013 17:01:56 -0400 Subject: [PATCH] Fix compiler/linker errors in Visual Studio introduced by recent commits M_PI is not part of the C++ standard and thus Visual Studio does not define it by default. --- include/fcl/narrowphase/narrowphase.h | 10 ++++++++++ test/test_fcl_sphere_capsule.cpp | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/include/fcl/narrowphase/narrowphase.h b/include/fcl/narrowphase/narrowphase.h index 54e3459a..9f3862e9 100644 --- a/include/fcl/narrowphase/narrowphase.h +++ b/include/fcl/narrowphase/narrowphase.h @@ -598,6 +598,11 @@ struct GJKSolver_indep FCL_REAL gjk_max_iterations; }; +template<> +bool GJKSolver_indep::shapeIntersect<Sphere, Capsule>(const Sphere &s1, const Transform3f& tf1, + const Capsule &s2, const Transform3f& tf2, + Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const; + /// @brief Fast implementation for sphere-sphere collision template<> bool GJKSolver_indep::shapeIntersect<Sphere, Sphere>(const Sphere& s1, const Transform3f& tf1, @@ -699,6 +704,11 @@ bool GJKSolver_indep::shapeTriangleIntersect(const Plane& s, const Transform3f& const Vec3f& P1, const Vec3f& P2, const Vec3f& P3, const Transform3f& tf2, Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const; +template<> +bool GJKSolver_indep::shapeDistance<Sphere, Capsule>(const Sphere& s1, const Transform3f& tf1, + const Capsule& s2, const Transform3f& tf2, + FCL_REAL* dist) const; + /// @brief Fast implementation for sphere-sphere distance template<> bool GJKSolver_indep::shapeDistance<Sphere, Sphere>(const Sphere& s1, const Transform3f& tf1, diff --git a/test/test_fcl_sphere_capsule.cpp b/test/test_fcl_sphere_capsule.cpp index eb4a421d..5da0def0 100644 --- a/test/test_fcl_sphere_capsule.cpp +++ b/test/test_fcl_sphere_capsule.cpp @@ -41,6 +41,10 @@ #include "fcl/shape/geometric_shapes.h" #include "fcl/narrowphase/narrowphase.h" +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + using namespace fcl; BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_z) -- GitLab