diff --git a/CMakeLists.txt b/CMakeLists.txt index aff3da82302e70a73b76c5c19294631db608ad76..3340fe2e9f94d54c8da5249bd6ae052d779edd60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,6 @@ SET(${PROJECT_NAME}_HEADERS include/hpp/fcl/math/matrix_3f.h include/hpp/fcl/math/vec_3f.h include/hpp/fcl/math/types.h - include/hpp/fcl/math/tools.h include/hpp/fcl/math/transform.h include/hpp/fcl/traversal/details/traversal.h include/hpp/fcl/traversal/traversal_node_shapes.h diff --git a/include/hpp/fcl/BV/AABB.h b/include/hpp/fcl/BV/AABB.h index c720f37a616f53625392fdc1ba04dde4cf9eb069..05859d25b1f359ebe000ecfa9d3ac9768af4e932 100644 --- a/include/hpp/fcl/BV/AABB.h +++ b/include/hpp/fcl/BV/AABB.h @@ -81,6 +81,30 @@ public: { } + + + + + + + + + +//start API in common test + /// @name Bounding volume API + /// Common API to BVs. + /// @{ + + /// @brief Check whether the AABB contains a point + inline bool contain(const Vec3f& p) const + { + if(p[0] < min_[0] || p[0] > max_[0]) return false; + if(p[1] < min_[1] || p[1] > max_[1]) return false; + if(p[2] < min_[2] || p[2] > max_[2]) return false; + + return true; + } + /// @brief Check whether two AABB are overlap inline bool overlap(const AABB& other) const { @@ -99,35 +123,11 @@ public: bool overlap(const AABB& other, const CollisionRequest& request, FCL_REAL& sqrDistLowerBound) const; - /// @brief Check whether the AABB contains another AABB - inline bool contain(const AABB& other) const - { - return (other.min_[0] >= min_[0]) && (other.max_[0] <= max_[0]) && (other.min_[1] >= min_[1]) && (other.max_[1] <= max_[1]) && (other.min_[2] >= min_[2]) && (other.max_[2] <= max_[2]); - } - - /// @brief Check whether two AABB are overlap and return the overlap part - inline bool overlap(const AABB& other, AABB& overlap_part) const - { - if(!overlap(other)) - { - return false; - } - - overlap_part.min_ = min_.cwiseMax(other.min_); - overlap_part.max_ = max_.cwiseMin(other.max_); - return true; - } - - - /// @brief Check whether the AABB contains a point - inline bool contain(const Vec3f& p) const - { - if(p[0] < min_[0] || p[0] > max_[0]) return false; - if(p[1] < min_[1] || p[1] > max_[1]) return false; - if(p[2] < min_[2] || p[2] > max_[2]) return false; + /// @brief Distance between two AABBs + FCL_REAL distance(const AABB& other) const; - return true; - } + /// @brief Distance between two AABBs; P and Q, should not be NULL, return the nearest points + FCL_REAL distance(const AABB& other, Vec3f* P, Vec3f* Q) const; /// @brief Merge the AABB and a point inline AABB& operator += (const Vec3f& p) @@ -152,6 +152,18 @@ public: return res += other; } + /// @brief Size of the AABB (used in BV_Splitter to order two AABBs) + inline FCL_REAL size() const + { + return (max_ - min_).squaredNorm(); + } + + /// @brief Center of the AABB + inline Vec3f center() const + { + return (min_ + max_) * 0.5; + } + /// @brief Width of the AABB inline FCL_REAL width() const { @@ -174,26 +186,42 @@ public: inline FCL_REAL volume() const { return width() * height() * depth(); - } + } - /// @brief Size of the AABB (used in BV_Splitter to order two AABBs) - inline FCL_REAL size() const + /// @} +//End API in common test + + + + + + + + + + + + + + /// @brief Check whether the AABB contains another AABB + inline bool contain(const AABB& other) const { - return (max_ - min_).squaredNorm(); + return (other.min_[0] >= min_[0]) && (other.max_[0] <= max_[0]) && (other.min_[1] >= min_[1]) && (other.max_[1] <= max_[1]) && (other.min_[2] >= min_[2]) && (other.max_[2] <= max_[2]); } - /// @brief Center of the AABB - inline Vec3f center() const + /// @brief Check whether two AABB are overlap and return the overlap part + inline bool overlap(const AABB& other, AABB& overlap_part) const { - return (min_ + max_) * 0.5; + if(!overlap(other)) + { + return false; + } + + overlap_part.min_ = min_.cwiseMax(other.min_); + overlap_part.max_ = max_.cwiseMin(other.max_); + return true; } - /// @brief Distance between two AABBs; P and Q, should not be NULL, return the nearest points - FCL_REAL distance(const AABB& other, Vec3f* P, Vec3f* Q) const; - - /// @brief Distance between two AABBs - FCL_REAL distance(const AABB& other) const; - /// @brief expand the half size of the AABB by delta, and keep the center unchanged. inline AABB& expand(const Vec3f& delta) { @@ -241,7 +269,6 @@ bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1, const AABB& b2 bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1, const AABB& b2, const CollisionRequest& request, FCL_REAL& sqrDistLowerBound); - } } // namespace hpp diff --git a/include/hpp/fcl/BV/OBB.h b/include/hpp/fcl/BV/OBB.h index 437f65957ff952380157b893a705782accd70999..3b1cb3f5dc09785c116e233256760c6234a50cbb 100644 --- a/include/hpp/fcl/BV/OBB.h +++ b/include/hpp/fcl/BV/OBB.h @@ -60,6 +60,12 @@ public: /// @brief Half dimensions of OBB Vec3f extent; + + + + /// @brief Check whether the OBB contains a point. + bool contain(const Vec3f& p) const; + /// Check collision between two OBB /// \return true if collision happens. bool overlap(const OBB& other) const; @@ -71,8 +77,8 @@ public: bool overlap(const OBB& other, const CollisionRequest& request, FCL_REAL& sqrDistLowerBound) const; - /// @brief Check whether the OBB contains a point. - bool contain(const Vec3f& p) const; + /// @brief Distance between two OBBs, not implemented. + FCL_REAL distance(const OBB& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; /// @brief A simple way to merge the OBB and a point (the result is not compact). OBB& operator += (const Vec3f& p); @@ -87,6 +93,18 @@ public: /// @brief Return the merged OBB of current OBB and the other one (the result is not compact). OBB operator + (const OBB& other) const; + /// @brief Size of the OBB (used in BV_Splitter to order two OBBs) + inline FCL_REAL size() const + { + return extent.squaredNorm(); + } + + /// @brief Center of the OBB + inline const Vec3f& center() const + { + return To; + } + /// @brief Width of the OBB. inline FCL_REAL width() const { @@ -110,22 +128,6 @@ public: { return width() * height() * depth(); } - - /// @brief Size of the OBB (used in BV_Splitter to order two OBBs) - inline FCL_REAL size() const - { - return extent.squaredNorm(); - } - - /// @brief Center of the OBB - inline const Vec3f& center() const - { - return To; - } - - - /// @brief Distance between two OBBs, not implemented. - FCL_REAL distance(const OBB& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; }; diff --git a/include/hpp/fcl/BV/OBBRSS.h b/include/hpp/fcl/BV/OBBRSS.h index 74fb3bffaaa60a8600bd8475594605d20f6d60f7..cb6ed77bd9307edb6b5173546feff655c6e0b516 100644 --- a/include/hpp/fcl/BV/OBBRSS.h +++ b/include/hpp/fcl/BV/OBBRSS.h @@ -59,6 +59,16 @@ public: /// @brief RSS member, for distance RSS rss; + + + + +/// @brief Check whether the OBBRSS contains a point + inline bool contain(const Vec3f& p) const + { + return obb.contain(p); + } + /// @brief Check collision between two OBBRSS bool overlap(const OBBRSS& other) const { @@ -74,10 +84,10 @@ public: return obb.overlap(other.obb, request, sqrDistLowerBound); } -/// @brief Check whether the OBBRSS contains a point - inline bool contain(const Vec3f& p) const + /// @brief Distance between two OBBRSS; P and Q , is not NULL, returns the nearest points + FCL_REAL distance(const OBBRSS& other, Vec3f* P = NULL, Vec3f* Q = NULL) const { - return obb.contain(p); + return rss.distance(other.rss, P, Q); } /// @brief Merge the OBBRSS and a point @@ -104,6 +114,18 @@ public: return result; } + /// @brief Size of the OBBRSS (used in BV_Splitter to order two OBBRSS) + inline FCL_REAL size() const + { + return obb.size(); + } + + /// @brief Center of the OBBRSS + inline const Vec3f& center() const + { + return obb.center(); + } + /// @brief Width of the OBRSS inline FCL_REAL width() const { @@ -127,25 +149,12 @@ public: { return obb.volume(); } +}; + + - /// @brief Size of the OBBRSS (used in BV_Splitter to order two OBBRSS) - inline FCL_REAL size() const - { - return obb.size(); - } - /// @brief Center of the OBBRSS - inline const Vec3f& center() const - { - return obb.center(); - } - /// @brief Distance between two OBBRSS; P and Q , is not NULL, returns the nearest points - FCL_REAL distance(const OBBRSS& other, Vec3f* P = NULL, Vec3f* Q = NULL) const - { - return rss.distance(other.rss, P, Q); - } -}; /// @brief Check collision between two OBBRSS, b1 is in configuration (R0, T0) and b2 is in indentity inline bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBBRSS& b1, const OBBRSS& b2) diff --git a/include/hpp/fcl/BV/RSS.h b/include/hpp/fcl/BV/RSS.h index a2c0111da817b431e877aeb690a2f0533678d8b3..e158d5cc7fd80cb7a482d4b579959101f9652cb7 100644 --- a/include/hpp/fcl/BV/RSS.h +++ b/include/hpp/fcl/BV/RSS.h @@ -65,6 +65,10 @@ public: /// @brief Radius of sphere summed with rectangle to form RSS FCL_REAL r; + + /// @brief Check whether the RSS contains a point + inline bool contain(const Vec3f& p) const; + /// @brief Check collision between two RSS bool overlap(const RSS& other) const; @@ -76,15 +80,8 @@ public: return overlap (other); } - /// @brief Check collision between two RSS and return the overlap part. - /// For RSS, we return nothing, as the overlap part of two RSSs usually is not a RSS. - bool overlap(const RSS& other, RSS& /*overlap_part*/) const - { - return overlap(other); - } - - /// @brief Check whether the RSS contains a point - inline bool contain(const Vec3f& p) const; + /// @brief the distance between two RSS; P and Q, if not NULL, return the nearest points + FCL_REAL distance(const RSS& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; /// @brief A simple way to merge the RSS and a point, not compact. /// @todo This function may have some bug. @@ -100,6 +97,19 @@ public: /// @brief Return the merged RSS of current RSS and the other one RSS operator + (const RSS& other) const; + + /// @brief Size of the RSS (used in BV_Splitter to order two RSSs) + inline FCL_REAL size() const + { + return (std::sqrt(l[0] * l[0] + l[1] * l[1]) + 2 * r); + } + + /// @brief The RSS center + inline const Vec3f& center() const + { + return Tr; + } + /// @brief Width of the RSS inline FCL_REAL width() const { @@ -124,21 +134,12 @@ public: return (l[0] * l[1] * 2 * r + 4 * boost::math::constants::pi<FCL_REAL>() * r * r * r); } - /// @brief Size of the RSS (used in BV_Splitter to order two RSSs) - inline FCL_REAL size() const - { - return (std::sqrt(l[0] * l[0] + l[1] * l[1]) + 2 * r); - } - - /// @brief The RSS center - inline const Vec3f& center() const + /// @brief Check collision between two RSS and return the overlap part. + /// For RSS, we return nothing, as the overlap part of two RSSs usually is not a RSS. + bool overlap(const RSS& other, RSS& /*overlap_part*/) const { - return Tr; + return overlap(other); } - - /// @brief the distance between two RSS; P and Q, if not NULL, return the nearest points - FCL_REAL distance(const RSS& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; - }; /// @brief distance between two RSS bounding volumes diff --git a/include/hpp/fcl/BV/kDOP.h b/include/hpp/fcl/BV/kDOP.h index 43c6db0972d0a52e58b45bee08b82be8a1765c5b..00af0f813c477e9780c23c49be5b0061bd6062ab 100644 --- a/include/hpp/fcl/BV/kDOP.h +++ b/include/hpp/fcl/BV/kDOP.h @@ -111,8 +111,8 @@ public: return overlap (other); } - //// @brief Check whether one point is inside the KDOP - bool inside(const Vec3f& p) const; + /// @brief The distance between two KDOP<N>. Not implemented. + FCL_REAL distance(const KDOP<N>& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; /// @brief Merge the point and the KDOP KDOP<N>& operator += (const Vec3f& p); @@ -123,6 +123,19 @@ public: /// @brief Create a KDOP by mergin two KDOPs KDOP<N> operator + (const KDOP<N>& other) const; + /// @brief Size of the kDOP (used in BV_Splitter to order two kDOPs) + inline FCL_REAL size() const + { + return width() * width() + height() * height() + depth() * depth(); + } + + /// @brief The (AABB) center + inline Vec3f center() const + { + return Vec3f(dist_[0] + dist_[N / 2], dist_[1] + dist_[N / 2 + 1], dist_[2] + dist_[N / 2 + 2]) * 0.5; + } + + /// @brief The (AABB) width inline FCL_REAL width() const { @@ -147,21 +160,6 @@ public: return width() * height() * depth(); } - /// @brief Size of the kDOP (used in BV_Splitter to order two kDOPs) - inline FCL_REAL size() const - { - return width() * width() + height() * height() + depth() * depth(); - } - - /// @brief The (AABB) center - inline Vec3f center() const - { - return Vec3f(dist_[0] + dist_[N / 2], dist_[1] + dist_[N / 2 + 1], dist_[2] + dist_[N / 2 + 2]) * 0.5; - } - - /// @brief The distance between two KDOP<N>. Not implemented. - FCL_REAL distance(const KDOP<N>& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; - inline FCL_REAL dist(std::size_t i) const { return dist_[i]; @@ -172,6 +170,8 @@ public: return dist_[i]; } + //// @brief Check whether one point is inside the KDOP + bool inside(const Vec3f& p) const; }; diff --git a/include/hpp/fcl/BV/kIOS.h b/include/hpp/fcl/BV/kIOS.h index 77ab3e45124ef9ce6e0b39f23490786ba3ee5d11..2227c9754a9b07707534cfaba04ab898bf7f56bb 100644 --- a/include/hpp/fcl/BV/kIOS.h +++ b/include/hpp/fcl/BV/kIOS.h @@ -93,6 +93,9 @@ public: /// @ OBB related with kIOS OBB obb; + /// @brief Check whether the kIOS contains a point + inline bool contain(const Vec3f& p) const; + /// @brief Check collision between two kIOS bool overlap(const kIOS& other) const; @@ -100,8 +103,8 @@ public: bool overlap(const kIOS& other, const CollisionRequest&, FCL_REAL& sqrDistLowerBound) const; - /// @brief Check whether the kIOS contains a point - inline bool contain(const Vec3f& p) const; + /// @brief The distance between two kIOS + FCL_REAL distance(const kIOS& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; /// @brief A simple way to merge the kIOS and a point kIOS& operator += (const Vec3f& p); @@ -116,6 +119,9 @@ public: /// @brief Return the merged kIOS of current kIOS and the other one kIOS operator + (const kIOS& other) const; + /// @brief size of the kIOS (used in BV_Splitter to order two kIOSs) + FCL_REAL size() const; + /// @brief Center of the kIOS const Vec3f& center() const { @@ -133,12 +139,6 @@ public: /// @brief Volume of the kIOS FCL_REAL volume() const; - - /// @brief size of the kIOS (used in BV_Splitter to order two kIOSs) - FCL_REAL size() const; - - /// @brief The distance between two kIOS - FCL_REAL distance(const kIOS& other, Vec3f* P = NULL, Vec3f* Q = NULL) const; }; diff --git a/include/hpp/fcl/traversal/traversal_node_bvh_shape.h b/include/hpp/fcl/traversal/traversal_node_bvh_shape.h index 0ae2c53c5f3a307c5f51e58cf268c01eee16557d..d1f4f007b12e094c6becd3be1daf756a2ca4f73d 100644 --- a/include/hpp/fcl/traversal/traversal_node_bvh_shape.h +++ b/include/hpp/fcl/traversal/traversal_node_bvh_shape.h @@ -746,11 +746,11 @@ public: }; -template<typename S, typename NarrowPhaseSolver> -class MeshShapeDistanceTraversalNodeOBBRSS : public MeshShapeDistanceTraversalNode<OBBRSS, S, NarrowPhaseSolver> +template<typename S, typename GJKSolver> +class MeshShapeDistanceTraversalNodeOBBRSS : public MeshShapeDistanceTraversalNode<OBBRSS, S, GJKSolver> { public: - MeshShapeDistanceTraversalNodeOBBRSS() : MeshShapeDistanceTraversalNode<OBBRSS, S, NarrowPhaseSolver>() + MeshShapeDistanceTraversalNodeOBBRSS() : MeshShapeDistanceTraversalNode<OBBRSS, S, GJKSolver>() { } @@ -780,7 +780,7 @@ public: }; /// @brief Traversal node for distance between shape and mesh -template<typename S, typename BV, typename NarrowPhaseSolver> +template<typename S, typename BV, typename GJKSolver> class ShapeMeshDistanceTraversalNode : public ShapeBVHDistanceTraversalNode<S, BV> { public: @@ -835,14 +835,14 @@ public: FCL_REAL rel_err; FCL_REAL abs_err; - const NarrowPhaseSolver* nsolver; + const GJKSolver* nsolver; }; -template<typename S, typename NarrowPhaseSolver> -class ShapeMeshDistanceTraversalNodeRSS : public ShapeMeshDistanceTraversalNode<S, RSS, NarrowPhaseSolver> +template<typename S, typename GJKSolver> +class ShapeMeshDistanceTraversalNodeRSS : public ShapeMeshDistanceTraversalNode<S, RSS, GJKSolver> { public: - ShapeMeshDistanceTraversalNodeRSS() : ShapeMeshDistanceTraversalNode<S, RSS, NarrowPhaseSolver>() + ShapeMeshDistanceTraversalNodeRSS() : ShapeMeshDistanceTraversalNode<S, RSS, GJKSolver>() { } @@ -870,11 +870,11 @@ public: }; -template<typename S, typename NarrowPhaseSolver> -class ShapeMeshDistanceTraversalNodekIOS : public ShapeMeshDistanceTraversalNode<S, kIOS, NarrowPhaseSolver> +template<typename S, typename GJKSolver> +class ShapeMeshDistanceTraversalNodekIOS : public ShapeMeshDistanceTraversalNode<S, kIOS, GJKSolver> { public: - ShapeMeshDistanceTraversalNodekIOS() : ShapeMeshDistanceTraversalNode<S, kIOS, NarrowPhaseSolver>() + ShapeMeshDistanceTraversalNodekIOS() : ShapeMeshDistanceTraversalNode<S, kIOS, GJKSolver>() { } @@ -902,11 +902,11 @@ public: }; -template<typename S, typename NarrowPhaseSolver> -class ShapeMeshDistanceTraversalNodeOBBRSS : public ShapeMeshDistanceTraversalNode<S, OBBRSS, NarrowPhaseSolver> +template<typename S, typename GJKSolver> +class ShapeMeshDistanceTraversalNodeOBBRSS : public ShapeMeshDistanceTraversalNode<S, OBBRSS, GJKSolver> { public: - ShapeMeshDistanceTraversalNodeOBBRSS() : ShapeMeshDistanceTraversalNode<S, OBBRSS, NarrowPhaseSolver>() + ShapeMeshDistanceTraversalNodeOBBRSS() : ShapeMeshDistanceTraversalNode<S, OBBRSS, GJKSolver>() { } diff --git a/include/hpp/fcl/traversal/traversal_node_octree.h b/include/hpp/fcl/traversal/traversal_node_octree.h index b9c47c07afb8f37ac7a8be75cb4a53e95e33a7e8..5473ff5149ef7b6700dbffa02e71f02ac614bc89 100644 --- a/include/hpp/fcl/traversal/traversal_node_octree.h +++ b/include/hpp/fcl/traversal/traversal_node_octree.h @@ -51,11 +51,11 @@ namespace fcl { /// @brief Algorithms for collision related with octree -template<typename NarrowPhaseSolver> +template<typename GJKSolver> class OcTreeSolver { private: - const NarrowPhaseSolver* solver; + const GJKSolver* solver; mutable const CollisionRequest* crequest; mutable const DistanceRequest* drequest; @@ -64,7 +64,7 @@ private: mutable DistanceResult* dresult; public: - OcTreeSolver(const NarrowPhaseSolver* solver_) : solver(solver_), + OcTreeSolver(const GJKSolver* solver_) : solver(solver_), crequest(NULL), drequest(NULL), cresult(NULL), @@ -890,7 +890,7 @@ private: /// @brief Traversal node for octree collision -template<typename NarrowPhaseSolver> +template<typename GJKSolver> class OcTreeCollisionTraversalNode : public CollisionTraversalNodeBase { public: @@ -923,11 +923,11 @@ public: Transform3f tf1, tf2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for octree distance -template<typename NarrowPhaseSolver> +template<typename GJKSolver> class OcTreeDistanceTraversalNode : public DistanceTraversalNodeBase { public: @@ -958,11 +958,11 @@ public: const OcTree* model1; const OcTree* model2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for shape-octree collision -template<typename S, typename NarrowPhaseSolver> +template<typename S, typename GJKSolver> class ShapeOcTreeCollisionTraversalNode : public CollisionTraversalNodeBase { public: @@ -995,11 +995,11 @@ public: Transform3f tf1, tf2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for octree-shape collision -template<typename S, typename NarrowPhaseSolver> +template<typename S, typename GJKSolver> class OcTreeShapeCollisionTraversalNode : public CollisionTraversalNodeBase { public: @@ -1032,11 +1032,11 @@ public: Transform3f tf1, tf2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for shape-octree distance -template<typename S, typename NarrowPhaseSolver> +template<typename S, typename GJKSolver> class ShapeOcTreeDistanceTraversalNode : public DistanceTraversalNodeBase { public: @@ -1061,11 +1061,11 @@ public: const S* model1; const OcTree* model2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for octree-shape distance -template<typename S, typename NarrowPhaseSolver> +template<typename S, typename GJKSolver> class OcTreeShapeDistanceTraversalNode : public DistanceTraversalNodeBase { public: @@ -1090,11 +1090,11 @@ public: const OcTree* model1; const S* model2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for mesh-octree collision -template<typename BV, typename NarrowPhaseSolver> +template<typename BV, typename GJKSolver> class MeshOcTreeCollisionTraversalNode : public CollisionTraversalNodeBase { public: @@ -1127,11 +1127,11 @@ public: Transform3f tf1, tf2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for octree-mesh collision -template<typename BV, typename NarrowPhaseSolver> +template<typename BV, typename GJKSolver> class OcTreeMeshCollisionTraversalNode : public CollisionTraversalNodeBase { public: @@ -1164,11 +1164,11 @@ public: Transform3f tf1, tf2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for mesh-octree distance -template<typename BV, typename NarrowPhaseSolver> +template<typename BV, typename GJKSolver> class MeshOcTreeDistanceTraversalNode : public DistanceTraversalNodeBase { public: @@ -1193,12 +1193,12 @@ public: const BVHModel<BV>* model1; const OcTree* model2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; /// @brief Traversal node for octree-mesh distance -template<typename BV, typename NarrowPhaseSolver> +template<typename BV, typename GJKSolver> class OcTreeMeshDistanceTraversalNode : public DistanceTraversalNodeBase { public: @@ -1223,7 +1223,7 @@ public: const OcTree* model1; const BVHModel<BV>* model2; - const OcTreeSolver<NarrowPhaseSolver>* otsolver; + const OcTreeSolver<GJKSolver>* otsolver; }; diff --git a/include/hpp/fcl/traversal/traversal_node_setup.h b/include/hpp/fcl/traversal/traversal_node_setup.h index 0912c231d15a567b242911d9e8ee60780ff5fc87..b5afcdd5f36650fc787ee3846d2cefb1171380b2 100644 --- a/include/hpp/fcl/traversal/traversal_node_setup.h +++ b/include/hpp/fcl/traversal/traversal_node_setup.h @@ -56,11 +56,11 @@ namespace fcl #ifdef HPP_FCL_HAVE_OCTOMAP /// @brief Initialize traversal node for collision between two octrees, given current object transform -template<typename NarrowPhaseSolver> -bool initialize(OcTreeCollisionTraversalNode<NarrowPhaseSolver>& node, +template<typename GJKSolver> +bool initialize(OcTreeCollisionTraversalNode<GJKSolver>& node, const OcTree& model1, const Transform3f& tf1, const OcTree& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, CollisionResult& result) { node.result = &result; @@ -77,11 +77,11 @@ bool initialize(OcTreeCollisionTraversalNode<NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance between two octrees, given current object transform -template<typename NarrowPhaseSolver> -bool initialize(OcTreeDistanceTraversalNode<NarrowPhaseSolver>& node, +template<typename GJKSolver> +bool initialize(OcTreeDistanceTraversalNode<GJKSolver>& node, const OcTree& model1, const Transform3f& tf1, const OcTree& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, const DistanceRequest& request, DistanceResult& result) { @@ -100,11 +100,11 @@ bool initialize(OcTreeDistanceTraversalNode<NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for collision between one shape and one octree, given current object transform -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeOcTreeCollisionTraversalNode<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeOcTreeCollisionTraversalNode<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const OcTree& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, CollisionResult& result) { node.result = &result; @@ -121,11 +121,11 @@ bool initialize(ShapeOcTreeCollisionTraversalNode<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for collision between one octree and one shape, given current object transform -template<typename S, typename NarrowPhaseSolver> -bool initialize(OcTreeShapeCollisionTraversalNode<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(OcTreeShapeCollisionTraversalNode<S, GJKSolver>& node, const OcTree& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, CollisionResult& result) { node.result = &result; @@ -142,11 +142,11 @@ bool initialize(OcTreeShapeCollisionTraversalNode<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance between one shape and one octree, given current object transform -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeOcTreeDistanceTraversalNode<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeOcTreeDistanceTraversalNode<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const OcTree& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, const DistanceRequest& request, DistanceResult& result) { @@ -165,11 +165,11 @@ bool initialize(ShapeOcTreeDistanceTraversalNode<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance between one octree and one shape, given current object transform -template<typename S, typename NarrowPhaseSolver> -bool initialize(OcTreeShapeDistanceTraversalNode<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(OcTreeShapeDistanceTraversalNode<S, GJKSolver>& node, const OcTree& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, const DistanceRequest& request, DistanceResult& result) { @@ -188,11 +188,11 @@ bool initialize(OcTreeShapeDistanceTraversalNode<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for collision between one mesh and one octree, given current object transform -template<typename BV, typename NarrowPhaseSolver> -bool initialize(MeshOcTreeCollisionTraversalNode<BV, NarrowPhaseSolver>& node, +template<typename BV, typename GJKSolver> +bool initialize(MeshOcTreeCollisionTraversalNode<BV, GJKSolver>& node, const BVHModel<BV>& model1, const Transform3f& tf1, const OcTree& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, CollisionResult& result) { node.result = &result; @@ -209,11 +209,11 @@ bool initialize(MeshOcTreeCollisionTraversalNode<BV, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for collision between one octree and one mesh, given current object transform -template<typename BV, typename NarrowPhaseSolver> -bool initialize(OcTreeMeshCollisionTraversalNode<BV, NarrowPhaseSolver>& node, +template<typename BV, typename GJKSolver> +bool initialize(OcTreeMeshCollisionTraversalNode<BV, GJKSolver>& node, const OcTree& model1, const Transform3f& tf1, const BVHModel<BV>& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, CollisionResult& result) { node.result = &result; @@ -230,11 +230,11 @@ bool initialize(OcTreeMeshCollisionTraversalNode<BV, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance between one mesh and one octree, given current object transform -template<typename BV, typename NarrowPhaseSolver> -bool initialize(MeshOcTreeDistanceTraversalNode<BV, NarrowPhaseSolver>& node, +template<typename BV, typename GJKSolver> +bool initialize(MeshOcTreeDistanceTraversalNode<BV, GJKSolver>& node, const BVHModel<BV>& model1, const Transform3f& tf1, const OcTree& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, const DistanceRequest& request, DistanceResult& result) { @@ -253,11 +253,11 @@ bool initialize(MeshOcTreeDistanceTraversalNode<BV, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for collision between one octree and one mesh, given current object transform -template<typename BV, typename NarrowPhaseSolver> -bool initialize(OcTreeMeshDistanceTraversalNode<BV, NarrowPhaseSolver>& node, +template<typename BV, typename GJKSolver> +bool initialize(OcTreeMeshDistanceTraversalNode<BV, GJKSolver>& node, const OcTree& model1, const Transform3f& tf1, const BVHModel<BV>& model2, const Transform3f& tf2, - const OcTreeSolver<NarrowPhaseSolver>* otsolver, + const OcTreeSolver<GJKSolver>* otsolver, const DistanceRequest& request, DistanceResult& result) { @@ -279,11 +279,11 @@ bool initialize(OcTreeMeshDistanceTraversalNode<BV, NarrowPhaseSolver>& node, /// @brief Initialize traversal node for collision between two geometric shapes, given current object transform -template<typename S1, typename S2, typename NarrowPhaseSolver> -bool initialize(ShapeCollisionTraversalNode<S1, S2, NarrowPhaseSolver>& node, +template<typename S1, typename S2, typename GJKSolver> +bool initialize(ShapeCollisionTraversalNode<S1, S2, GJKSolver>& node, const S1& shape1, const Transform3f& tf1, const S2& shape2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { node.model1 = &shape1; @@ -298,11 +298,11 @@ bool initialize(ShapeCollisionTraversalNode<S1, S2, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for collision between one mesh and one shape, given current object transform -template<typename BV, typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeCollisionTraversalNode<BV, S, NarrowPhaseSolver>& node, +template<typename BV, typename S, typename GJKSolver> +bool initialize(MeshShapeCollisionTraversalNode<BV, S, GJKSolver>& node, BVHModel<BV>& model1, Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result, bool use_refit = false, bool refit_bottomup = false) { @@ -344,11 +344,11 @@ bool initialize(MeshShapeCollisionTraversalNode<BV, S, NarrowPhaseSolver>& node, /// @brief Initialize traversal node for collision between one mesh and one shape, given current object transform -template<typename S, typename BV, typename NarrowPhaseSolver> -bool initialize(ShapeMeshCollisionTraversalNode<S, BV, NarrowPhaseSolver>& node, +template<typename S, typename BV, typename GJKSolver> +bool initialize(ShapeMeshCollisionTraversalNode<S, BV, GJKSolver>& node, const S& model1, const Transform3f& tf1, BVHModel<BV>& model2, Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result, bool use_refit = false, bool refit_bottomup = false) { @@ -392,11 +392,11 @@ bool initialize(ShapeMeshCollisionTraversalNode<S, BV, NarrowPhaseSolver>& node, namespace details { -template<typename BV, typename S, typename NarrowPhaseSolver, template<typename, typename> class OrientedNode> -static inline bool setupMeshShapeCollisionOrientedNode(OrientedNode<S, NarrowPhaseSolver>& node, +template<typename BV, typename S, typename GJKSolver, template<typename, typename> class OrientedNode> +static inline bool setupMeshShapeCollisionOrientedNode(OrientedNode<S, GJKSolver>& node, const BVHModel<BV>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { if(model1.getModelType() != BVH_MODEL_TRIANGLES) @@ -424,44 +424,44 @@ static inline bool setupMeshShapeCollisionOrientedNode(OrientedNode<S, NarrowPha /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for OBB type -template<typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeCollisionTraversalNodeOBB<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(MeshShapeCollisionTraversalNodeOBB<S, GJKSolver>& node, const BVHModel<OBB>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupMeshShapeCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); } /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for RSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeCollisionTraversalNodeRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(MeshShapeCollisionTraversalNodeRSS<S, GJKSolver>& node, const BVHModel<RSS>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupMeshShapeCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); } /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for kIOS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeCollisionTraversalNodekIOS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(MeshShapeCollisionTraversalNodekIOS<S, GJKSolver>& node, const BVHModel<kIOS>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupMeshShapeCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); } /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for OBBRSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeCollisionTraversalNodeOBBRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(MeshShapeCollisionTraversalNodeOBBRSS<S, GJKSolver>& node, const BVHModel<OBBRSS>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupMeshShapeCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); @@ -471,11 +471,11 @@ bool initialize(MeshShapeCollisionTraversalNodeOBBRSS<S, NarrowPhaseSolver>& nod /// @cond IGNORE namespace details { -template<typename S, typename BV, typename NarrowPhaseSolver, template<typename, typename> class OrientedNode> -static inline bool setupShapeMeshCollisionOrientedNode(OrientedNode<S, NarrowPhaseSolver>& node, +template<typename S, typename BV, typename GJKSolver, template<typename, typename> class OrientedNode> +static inline bool setupShapeMeshCollisionOrientedNode(OrientedNode<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<BV>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { if(model2.getModelType() != BVH_MODEL_TRIANGLES) @@ -500,44 +500,44 @@ static inline bool setupShapeMeshCollisionOrientedNode(OrientedNode<S, NarrowPha /// @endcond /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for OBB type -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeMeshCollisionTraversalNodeOBB<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeMeshCollisionTraversalNodeOBB<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<OBB>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupShapeMeshCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); } /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for RSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeMeshCollisionTraversalNodeRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeMeshCollisionTraversalNodeRSS<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<RSS>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupShapeMeshCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); } /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for kIOS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeMeshCollisionTraversalNodekIOS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeMeshCollisionTraversalNodekIOS<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<kIOS>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupShapeMeshCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); } /// @brief Initialize the traversal node for collision between one mesh and one shape, specialized for OBBRSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeMeshCollisionTraversalNodeOBBRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeMeshCollisionTraversalNodeOBBRSS<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<OBBRSS>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, CollisionResult& result) { return details::setupShapeMeshCollisionOrientedNode(node, model1, tf1, model2, tf2, nsolver, result); @@ -636,11 +636,11 @@ bool initialize(MeshCollisionTraversalNode<BV, 0>& node, } /// @brief Initialize traversal node for distance between two geometric shapes -template<typename S1, typename S2, typename NarrowPhaseSolver> -bool initialize(ShapeDistanceTraversalNode<S1, S2, NarrowPhaseSolver>& node, +template<typename S1, typename S2, typename GJKSolver> +bool initialize(ShapeDistanceTraversalNode<S1, S2, GJKSolver>& node, const S1& shape1, const Transform3f& tf1, const S2& shape2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -742,11 +742,11 @@ bool initialize(MeshDistanceTraversalNodeOBBRSS& node, DistanceResult& result); /// @brief Initialize traversal node for distance computation between one mesh and one shape, given the current transforms -template<typename BV, typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeDistanceTraversalNode<BV, S, NarrowPhaseSolver>& node, +template<typename BV, typename S, typename GJKSolver> +bool initialize(MeshShapeDistanceTraversalNode<BV, S, GJKSolver>& node, BVHModel<BV>& model1, Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result, bool use_refit = false, bool refit_bottomup = false) @@ -789,11 +789,11 @@ bool initialize(MeshShapeDistanceTraversalNode<BV, S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance computation between one shape and one mesh, given the current transforms -template<typename S, typename BV, typename NarrowPhaseSolver> -bool initialize(ShapeMeshDistanceTraversalNode<S, BV, NarrowPhaseSolver>& node, +template<typename S, typename BV, typename GJKSolver> +bool initialize(ShapeMeshDistanceTraversalNode<S, BV, GJKSolver>& node, const S& model1, const Transform3f& tf1, BVHModel<BV>& model2, Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result, bool use_refit = false, bool refit_bottomup = false) @@ -839,11 +839,11 @@ bool initialize(ShapeMeshDistanceTraversalNode<S, BV, NarrowPhaseSolver>& node, namespace details { -template<typename BV, typename S, typename NarrowPhaseSolver, template<typename, typename> class OrientedNode> -static inline bool setupMeshShapeDistanceOrientedNode(OrientedNode<S, NarrowPhaseSolver>& node, +template<typename BV, typename S, typename GJKSolver, template<typename, typename> class OrientedNode> +static inline bool setupMeshShapeDistanceOrientedNode(OrientedNode<S, GJKSolver>& node, const BVHModel<BV>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -870,11 +870,11 @@ static inline bool setupMeshShapeDistanceOrientedNode(OrientedNode<S, NarrowPhas /// @endcond /// @brief Initialize traversal node for distance computation between one mesh and one shape, specialized for RSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeDistanceTraversalNodeRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(MeshShapeDistanceTraversalNodeRSS<S, GJKSolver>& node, const BVHModel<RSS>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -882,11 +882,11 @@ bool initialize(MeshShapeDistanceTraversalNodeRSS<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance computation between one mesh and one shape, specialized for kIOS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeDistanceTraversalNodekIOS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(MeshShapeDistanceTraversalNodekIOS<S, GJKSolver>& node, const BVHModel<kIOS>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -894,11 +894,11 @@ bool initialize(MeshShapeDistanceTraversalNodekIOS<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance computation between one mesh and one shape, specialized for OBBRSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(MeshShapeDistanceTraversalNodeOBBRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(MeshShapeDistanceTraversalNodeOBBRSS<S, GJKSolver>& node, const BVHModel<OBBRSS>& model1, const Transform3f& tf1, const S& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -908,11 +908,11 @@ bool initialize(MeshShapeDistanceTraversalNodeOBBRSS<S, NarrowPhaseSolver>& node namespace details { -template<typename S, typename BV, typename NarrowPhaseSolver, template<typename, typename> class OrientedNode> -static inline bool setupShapeMeshDistanceOrientedNode(OrientedNode<S, NarrowPhaseSolver>& node, +template<typename S, typename BV, typename GJKSolver, template<typename, typename> class OrientedNode> +static inline bool setupShapeMeshDistanceOrientedNode(OrientedNode<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<BV>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -941,11 +941,11 @@ static inline bool setupShapeMeshDistanceOrientedNode(OrientedNode<S, NarrowPhas /// @brief Initialize traversal node for distance computation between one shape and one mesh, specialized for RSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeMeshDistanceTraversalNodeRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeMeshDistanceTraversalNodeRSS<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<RSS>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -953,11 +953,11 @@ bool initialize(ShapeMeshDistanceTraversalNodeRSS<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance computation between one shape and one mesh, specialized for kIOS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeMeshDistanceTraversalNodekIOS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeMeshDistanceTraversalNodekIOS<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<kIOS>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { @@ -965,11 +965,11 @@ bool initialize(ShapeMeshDistanceTraversalNodekIOS<S, NarrowPhaseSolver>& node, } /// @brief Initialize traversal node for distance computation between one shape and one mesh, specialized for OBBRSS type -template<typename S, typename NarrowPhaseSolver> -bool initialize(ShapeMeshDistanceTraversalNodeOBBRSS<S, NarrowPhaseSolver>& node, +template<typename S, typename GJKSolver> +bool initialize(ShapeMeshDistanceTraversalNodeOBBRSS<S, GJKSolver>& node, const S& model1, const Transform3f& tf1, const BVHModel<OBBRSS>& model2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { diff --git a/include/hpp/fcl/traversal/traversal_node_shapes.h b/include/hpp/fcl/traversal/traversal_node_shapes.h index 5180e9dcb43fe097e3be7730be259ee6e2feea8a..9ed5e4e7041288df079055f62aaab991bbb2edaf 100644 --- a/include/hpp/fcl/traversal/traversal_node_shapes.h +++ b/include/hpp/fcl/traversal/traversal_node_shapes.h @@ -53,7 +53,7 @@ namespace fcl /// @brief Traversal node for collision between two shapes -template<typename S1, typename S2, typename NarrowPhaseSolver> +template<typename S1, typename S2, typename GJKSolver> class ShapeCollisionTraversalNode : public CollisionTraversalNodeBase { public: @@ -111,11 +111,11 @@ public: const S1* model1; const S2* model2; - const NarrowPhaseSolver* nsolver; + const GJKSolver* nsolver; }; /// @brief Traversal node for distance between two shapes -template<typename S1, typename S2, typename NarrowPhaseSolver> +template<typename S1, typename S2, typename GJKSolver> class ShapeDistanceTraversalNode : public DistanceTraversalNodeBase { public: @@ -147,7 +147,7 @@ public: const S1* model1; const S2* model2; - const NarrowPhaseSolver* nsolver; + const GJKSolver* nsolver; }; } diff --git a/src/BV/OBB.cpp b/src/BV/OBB.cpp index 1106c965d68b9e89559aa80a3cdbc39e99878530..d089a77bad653a27a575db85411aaa67f20af01c 100644 --- a/src/BV/OBB.cpp +++ b/src/BV/OBB.cpp @@ -39,7 +39,7 @@ #include <hpp/fcl/BVH/BVH_utility.h> #include <hpp/fcl/math/transform.h> #include <hpp/fcl/collision_data.h> -#include <hpp/fcl/math/tools.h> +#include "../math/tools.h" #include <iostream> #include <limits> diff --git a/src/BV/RSS.cpp b/src/BV/RSS.cpp index 75dd554d812c12a1864d1816315c924f678b58ea..ff3563cc29bf3ab591cbcdd65d5bfedd508a56d8 100644 --- a/src/BV/RSS.cpp +++ b/src/BV/RSS.cpp @@ -38,7 +38,7 @@ #include <hpp/fcl/BV/RSS.h> #include <hpp/fcl/BVH/BVH_utility.h> #include <iostream> -#include <hpp/fcl/math/tools.h> +#include "../math/tools.h" namespace hpp { namespace fcl diff --git a/src/BVH/BV_fitter.cpp b/src/BVH/BV_fitter.cpp index 3ef215079e236f369b65522293f76fbc1eaf4c91..d04481fb84f451b065881f26c5a4d9060fc83249 100644 --- a/src/BVH/BV_fitter.cpp +++ b/src/BVH/BV_fitter.cpp @@ -38,7 +38,7 @@ #include <hpp/fcl/BVH/BV_fitter.h> #include <hpp/fcl/BVH/BVH_utility.h> #include <limits> -#include <hpp/fcl/math/tools.h> +#include "../math/tools.h" namespace hpp { diff --git a/src/collision.cpp b/src/collision.cpp index c5405037d4e9cd41d46acf2596467c5d48efcd01..b6a45e8301499083696e1cb48ff2e4aa51671f86 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -54,9 +54,9 @@ CollisionFunctionMatrix<GJKSolver>& getCollisionFunctionLookTable() return table; } -template<typename NarrowPhaseSolver> +template<typename GJKSolver> std::size_t collide(const CollisionObject* o1, const CollisionObject* o2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { @@ -81,18 +81,18 @@ void invertResults(CollisionResult& result) } } -template<typename NarrowPhaseSolver> +template<typename GJKSolver> std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver_, + const GJKSolver* nsolver_, const CollisionRequest& request, CollisionResult& result) { - const NarrowPhaseSolver* nsolver = nsolver_; + const GJKSolver* nsolver = nsolver_; if(!nsolver_) - nsolver = new NarrowPhaseSolver(); + nsolver = new GJKSolver(); - const CollisionFunctionMatrix<NarrowPhaseSolver>& looktable = getCollisionFunctionLookTable<NarrowPhaseSolver>(); + const CollisionFunctionMatrix<GJKSolver>& looktable = getCollisionFunctionLookTable<GJKSolver>(); result.distance_lower_bound = -1; std::size_t res; if(request.num_max_contacts == 0) diff --git a/src/collision_func_matrix.cpp b/src/collision_func_matrix.cpp index 69b01a281455a764e4fedbdb3414c52405b22313..fec09ba751cbc1ebac88f4ab03487bd803b04d38 100644 --- a/src/collision_func_matrix.cpp +++ b/src/collision_func_matrix.cpp @@ -49,17 +49,17 @@ namespace fcl { #ifdef HPP_FCL_HAVE_OCTOMAP -template<typename T_SH, typename NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> std::size_t ShapeOcTreeCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); - ShapeOcTreeCollisionTraversalNode<T_SH, NarrowPhaseSolver> node (request); + ShapeOcTreeCollisionTraversalNode<T_SH, GJKSolver> node (request); const T_SH* obj1 = static_cast<const T_SH*>(o1); const OcTree* obj2 = static_cast<const OcTree*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, result); collide(&node, request, result); @@ -67,17 +67,17 @@ std::size_t ShapeOcTreeCollide(const CollisionGeometry* o1, const Transform3f& t return result.numContacts(); } -template<typename T_SH, typename NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> std::size_t OcTreeShapeCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); - OcTreeShapeCollisionTraversalNode<T_SH, NarrowPhaseSolver> node (request); + OcTreeShapeCollisionTraversalNode<T_SH, GJKSolver> node (request); const OcTree* obj1 = static_cast<const OcTree*>(o1); const T_SH* obj2 = static_cast<const T_SH*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, result); collide(&node, request, result); @@ -85,17 +85,17 @@ std::size_t OcTreeShapeCollide(const CollisionGeometry* o1, const Transform3f& t return result.numContacts(); } -template<typename NarrowPhaseSolver> +template<typename GJKSolver> std::size_t OcTreeCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); - OcTreeCollisionTraversalNode<NarrowPhaseSolver> node (request); + OcTreeCollisionTraversalNode<GJKSolver> node (request); const OcTree* obj1 = static_cast<const OcTree*>(o1); const OcTree* obj2 = static_cast<const OcTree*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, result); collide(&node, request, result); @@ -103,34 +103,34 @@ std::size_t OcTreeCollide(const CollisionGeometry* o1, const Transform3f& tf1, c return result.numContacts(); } -template<typename T_BVH, typename NarrowPhaseSolver> +template<typename T_BVH, typename GJKSolver> std::size_t OcTreeBVHCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); - OcTreeMeshCollisionTraversalNode<T_BVH, NarrowPhaseSolver> node (request); + OcTreeMeshCollisionTraversalNode<T_BVH, GJKSolver> node (request); const OcTree* obj1 = static_cast<const OcTree*>(o1); const BVHModel<T_BVH>* obj2 = static_cast<const BVHModel<T_BVH>*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, result); collide(&node, request, result); return result.numContacts(); } -template<typename T_BVH, typename NarrowPhaseSolver> +template<typename T_BVH, typename GJKSolver> std::size_t BVHOcTreeCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); - MeshOcTreeCollisionTraversalNode<T_BVH, NarrowPhaseSolver> node (request); + MeshOcTreeCollisionTraversalNode<T_BVH, GJKSolver> node (request); const BVHModel<T_BVH>* obj1 = static_cast<const BVHModel<T_BVH>*>(o1); const OcTree* obj2 = static_cast<const OcTree*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, result); collide(&node, request, result); @@ -139,16 +139,16 @@ std::size_t BVHOcTreeCollide(const CollisionGeometry* o1, const Transform3f& tf1 #endif -template<typename T_SH1, typename T_SH2, typename NarrowPhaseSolver> +template<typename T_SH1, typename T_SH2, typename GJKSolver> std::size_t ShapeShapeCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); DistanceResult distanceResult; DistanceRequest distanceRequest (request.enable_contact); - FCL_REAL distance = ShapeShapeDistance <T_SH1, T_SH2, NarrowPhaseSolver> + FCL_REAL distance = ShapeShapeDistance <T_SH1, T_SH2, GJKSolver> (o1, tf1, o2, tf2, nsolver, distanceRequest, distanceResult); if (distance <= 0) { @@ -179,16 +179,16 @@ std::size_t ShapeShapeCollide(const CollisionGeometry* o1, const Transform3f& tf return 0; } -template<typename T_BVH, typename T_SH, typename NarrowPhaseSolver> +template<typename T_BVH, typename T_SH, typename GJKSolver> struct BVHShapeCollider { static std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); - MeshShapeCollisionTraversalNode<T_BVH, T_SH, NarrowPhaseSolver> node (request); + MeshShapeCollisionTraversalNode<T_BVH, T_SH, GJKSolver> node (request); const BVHModel<T_BVH>* obj1 = static_cast<const BVHModel<T_BVH>* >(o1); BVHModel<T_BVH>* obj1_tmp = new BVHModel<T_BVH>(*obj1); Transform3f tf1_tmp = tf1; @@ -205,9 +205,9 @@ struct BVHShapeCollider namespace details { -template<typename OrientMeshShapeCollisionTraveralNode, typename T_BVH, typename T_SH, typename NarrowPhaseSolver> +template<typename OrientMeshShapeCollisionTraveralNode, typename T_BVH, typename T_SH, typename GJKSolver> std::size_t orientedBVHShapeCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { if(request.isSatisfied(result)) return result.numContacts(); @@ -224,50 +224,50 @@ std::size_t orientedBVHShapeCollide(const CollisionGeometry* o1, const Transform } -template<typename T_SH, typename NarrowPhaseSolver> -struct BVHShapeCollider<OBB, T_SH, NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> +struct BVHShapeCollider<OBB, T_SH, GJKSolver> { static std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { - return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodeOBB<T_SH, NarrowPhaseSolver>, OBB, T_SH, NarrowPhaseSolver>(o1, tf1, o2, tf2, nsolver, request, result); + return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodeOBB<T_SH, GJKSolver>, OBB, T_SH, GJKSolver>(o1, tf1, o2, tf2, nsolver, request, result); } }; -template<typename T_SH, typename NarrowPhaseSolver> -struct BVHShapeCollider<RSS, T_SH, NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> +struct BVHShapeCollider<RSS, T_SH, GJKSolver> { static std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { - return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodeRSS<T_SH, NarrowPhaseSolver>, RSS, T_SH, NarrowPhaseSolver>(o1, tf1, o2, tf2, nsolver, request, result); + return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodeRSS<T_SH, GJKSolver>, RSS, T_SH, GJKSolver>(o1, tf1, o2, tf2, nsolver, request, result); } }; -template<typename T_SH, typename NarrowPhaseSolver> -struct BVHShapeCollider<kIOS, T_SH, NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> +struct BVHShapeCollider<kIOS, T_SH, GJKSolver> { static std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { - return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodekIOS<T_SH, NarrowPhaseSolver>, kIOS, T_SH, NarrowPhaseSolver>(o1, tf1, o2, tf2, nsolver, request, result); + return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodekIOS<T_SH, GJKSolver>, kIOS, T_SH, GJKSolver>(o1, tf1, o2, tf2, nsolver, request, result); } }; -template<typename T_SH, typename NarrowPhaseSolver> -struct BVHShapeCollider<OBBRSS, T_SH, NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> +struct BVHShapeCollider<OBBRSS, T_SH, GJKSolver> { static std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result) { - return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodeOBBRSS<T_SH, NarrowPhaseSolver>, OBBRSS, T_SH, NarrowPhaseSolver>(o1, tf1, o2, tf2, nsolver, request, result); + return details::orientedBVHShapeCollide<MeshShapeCollisionTraversalNodeOBBRSS<T_SH, GJKSolver>, OBBRSS, T_SH, GJKSolver>(o1, tf1, o2, tf2, nsolver, request, result); } }; @@ -333,17 +333,17 @@ std::size_t BVHCollide<kIOS>(const CollisionGeometry* o1, const Transform3f& tf1 } -template<typename T_BVH, typename NarrowPhaseSolver> +template<typename T_BVH, typename GJKSolver> std::size_t BVHCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* /*nsolver*/, + const GJKSolver* /*nsolver*/, const CollisionRequest& request, CollisionResult& result) { return BVHCollide<T_BVH>(o1, tf1, o2, tf2, request, result); } -template<typename NarrowPhaseSolver> -CollisionFunctionMatrix<NarrowPhaseSolver>::CollisionFunctionMatrix() +template<typename GJKSolver> +CollisionFunctionMatrix<GJKSolver>::CollisionFunctionMatrix() { for(int i = 0; i < NODE_COUNT; ++i) { @@ -351,197 +351,197 @@ CollisionFunctionMatrix<NarrowPhaseSolver>::CollisionFunctionMatrix() collision_matrix[i][j] = NULL; } - collision_matrix[GEOM_BOX][GEOM_BOX] = &ShapeShapeCollide<Box, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_BOX][GEOM_SPHERE] = &ShapeShapeCollide<Box, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_BOX][GEOM_CAPSULE] = &ShapeShapeCollide<Box, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_BOX][GEOM_CONE] = &ShapeShapeCollide<Box, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_BOX][GEOM_CYLINDER] = &ShapeShapeCollide<Box, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_BOX][GEOM_CONVEX] = &ShapeShapeCollide<Box, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_BOX][GEOM_PLANE] = &ShapeShapeCollide<Box, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_BOX][GEOM_HALFSPACE] = &ShapeShapeCollide<Box, Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_SPHERE][GEOM_BOX] = &ShapeShapeCollide<Sphere, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_SPHERE] = &ShapeShapeCollide<Sphere, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_CAPSULE] = &ShapeShapeCollide<Sphere, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_CONE] = &ShapeShapeCollide<Sphere, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_CYLINDER] = &ShapeShapeCollide<Sphere, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_CONVEX] = &ShapeShapeCollide<Sphere, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_PLANE] = &ShapeShapeCollide<Sphere, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_HALFSPACE] = &ShapeShapeCollide<Sphere, Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_CAPSULE][GEOM_BOX] = &ShapeShapeCollide<Capsule, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_SPHERE] = &ShapeShapeCollide<Capsule, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_CAPSULE] = &ShapeShapeCollide<Capsule, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_CONE] = &ShapeShapeCollide<Capsule, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_CYLINDER] = &ShapeShapeCollide<Capsule, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_CONVEX] = &ShapeShapeCollide<Capsule, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_PLANE] = &ShapeShapeCollide<Capsule, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_HALFSPACE] = &ShapeShapeCollide<Capsule, Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_CONE][GEOM_BOX] = &ShapeShapeCollide<Cone, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_SPHERE] = &ShapeShapeCollide<Cone, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_CAPSULE] = &ShapeShapeCollide<Cone, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_CONE] = &ShapeShapeCollide<Cone, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_CYLINDER] = &ShapeShapeCollide<Cone, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_CONVEX] = &ShapeShapeCollide<Cone, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_PLANE] = &ShapeShapeCollide<Cone, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_HALFSPACE] = &ShapeShapeCollide<Cone, Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_CYLINDER][GEOM_BOX] = &ShapeShapeCollide<Cylinder, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_SPHERE] = &ShapeShapeCollide<Cylinder, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_CAPSULE] = &ShapeShapeCollide<Cylinder, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_CONE] = &ShapeShapeCollide<Cylinder, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_CYLINDER] = &ShapeShapeCollide<Cylinder, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_CONVEX] = &ShapeShapeCollide<Cylinder, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_PLANE] = &ShapeShapeCollide<Cylinder, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_HALFSPACE] = &ShapeShapeCollide<Cylinder, Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_CONVEX][GEOM_BOX] = &ShapeShapeCollide<Convex, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_SPHERE] = &ShapeShapeCollide<Convex, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_CAPSULE] = &ShapeShapeCollide<Convex, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_CONE] = &ShapeShapeCollide<Convex, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_CYLINDER] = &ShapeShapeCollide<Convex, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_CONVEX] = &ShapeShapeCollide<Convex, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_PLANE] = &ShapeShapeCollide<Convex, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_HALFSPACE] = &ShapeShapeCollide<Convex, Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_PLANE][GEOM_BOX] = &ShapeShapeCollide<Plane, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_SPHERE] = &ShapeShapeCollide<Plane, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_CAPSULE] = &ShapeShapeCollide<Plane, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_CONE] = &ShapeShapeCollide<Plane, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_CYLINDER] = &ShapeShapeCollide<Plane, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_CONVEX] = &ShapeShapeCollide<Plane, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_PLANE] = &ShapeShapeCollide<Plane, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_HALFSPACE] = &ShapeShapeCollide<Plane, Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_HALFSPACE][GEOM_BOX] = &ShapeShapeCollide<Halfspace, Box, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_SPHERE] = &ShapeShapeCollide<Halfspace, Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_CAPSULE] = &ShapeShapeCollide<Halfspace, Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_CONE] = &ShapeShapeCollide<Halfspace, Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_CYLINDER] = &ShapeShapeCollide<Halfspace, Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_CONVEX] = &ShapeShapeCollide<Halfspace, Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_PLANE] = &ShapeShapeCollide<Halfspace, Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeCollide<Halfspace, Halfspace, NarrowPhaseSolver>; - - collision_matrix[BV_AABB][GEOM_BOX] = &BVHShapeCollider<AABB, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_AABB][GEOM_SPHERE] = &BVHShapeCollider<AABB, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_AABB][GEOM_CAPSULE] = &BVHShapeCollider<AABB, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_AABB][GEOM_CONE] = &BVHShapeCollider<AABB, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_AABB][GEOM_CYLINDER] = &BVHShapeCollider<AABB, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_AABB][GEOM_CONVEX] = &BVHShapeCollider<AABB, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_AABB][GEOM_PLANE] = &BVHShapeCollider<AABB, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_AABB][GEOM_HALFSPACE] = &BVHShapeCollider<AABB, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_OBB][GEOM_BOX] = &BVHShapeCollider<OBB, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBB][GEOM_SPHERE] = &BVHShapeCollider<OBB, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBB][GEOM_CAPSULE] = &BVHShapeCollider<OBB, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBB][GEOM_CONE] = &BVHShapeCollider<OBB, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBB][GEOM_CYLINDER] = &BVHShapeCollider<OBB, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBB][GEOM_CONVEX] = &BVHShapeCollider<OBB, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBB][GEOM_PLANE] = &BVHShapeCollider<OBB, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBB][GEOM_HALFSPACE] = &BVHShapeCollider<OBB, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_RSS][GEOM_BOX] = &BVHShapeCollider<RSS, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_RSS][GEOM_SPHERE] = &BVHShapeCollider<RSS, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_RSS][GEOM_CAPSULE] = &BVHShapeCollider<RSS, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_RSS][GEOM_CONE] = &BVHShapeCollider<RSS, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_RSS][GEOM_CYLINDER] = &BVHShapeCollider<RSS, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_RSS][GEOM_CONVEX] = &BVHShapeCollider<RSS, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_RSS][GEOM_PLANE] = &BVHShapeCollider<RSS, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_RSS][GEOM_HALFSPACE] = &BVHShapeCollider<RSS, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_KDOP16][GEOM_BOX] = &BVHShapeCollider<KDOP<16>, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP16][GEOM_SPHERE] = &BVHShapeCollider<KDOP<16>, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP16][GEOM_CAPSULE] = &BVHShapeCollider<KDOP<16>, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP16][GEOM_CONE] = &BVHShapeCollider<KDOP<16>, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP16][GEOM_CYLINDER] = &BVHShapeCollider<KDOP<16>, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP16][GEOM_CONVEX] = &BVHShapeCollider<KDOP<16>, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP16][GEOM_PLANE] = &BVHShapeCollider<KDOP<16>, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP16][GEOM_HALFSPACE] = &BVHShapeCollider<KDOP<16>, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_KDOP18][GEOM_BOX] = &BVHShapeCollider<KDOP<18>, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP18][GEOM_SPHERE] = &BVHShapeCollider<KDOP<18>, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP18][GEOM_CAPSULE] = &BVHShapeCollider<KDOP<18>, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP18][GEOM_CONE] = &BVHShapeCollider<KDOP<18>, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP18][GEOM_CYLINDER] = &BVHShapeCollider<KDOP<18>, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP18][GEOM_CONVEX] = &BVHShapeCollider<KDOP<18>, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP18][GEOM_PLANE] = &BVHShapeCollider<KDOP<18>, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP18][GEOM_HALFSPACE] = &BVHShapeCollider<KDOP<18>, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_KDOP24][GEOM_BOX] = &BVHShapeCollider<KDOP<24>, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP24][GEOM_SPHERE] = &BVHShapeCollider<KDOP<24>, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP24][GEOM_CAPSULE] = &BVHShapeCollider<KDOP<24>, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP24][GEOM_CONE] = &BVHShapeCollider<KDOP<24>, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP24][GEOM_CYLINDER] = &BVHShapeCollider<KDOP<24>, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP24][GEOM_CONVEX] = &BVHShapeCollider<KDOP<24>, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP24][GEOM_PLANE] = &BVHShapeCollider<KDOP<24>, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_KDOP24][GEOM_HALFSPACE] = &BVHShapeCollider<KDOP<24>, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_kIOS][GEOM_BOX] = &BVHShapeCollider<kIOS, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_kIOS][GEOM_SPHERE] = &BVHShapeCollider<kIOS, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_kIOS][GEOM_CAPSULE] = &BVHShapeCollider<kIOS, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_kIOS][GEOM_CONE] = &BVHShapeCollider<kIOS, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_kIOS][GEOM_CYLINDER] = &BVHShapeCollider<kIOS, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_kIOS][GEOM_CONVEX] = &BVHShapeCollider<kIOS, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_kIOS][GEOM_PLANE] = &BVHShapeCollider<kIOS, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_kIOS][GEOM_HALFSPACE] = &BVHShapeCollider<kIOS, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_OBBRSS][GEOM_BOX] = &BVHShapeCollider<OBBRSS, Box, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBBRSS][GEOM_SPHERE] = &BVHShapeCollider<OBBRSS, Sphere, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBBRSS][GEOM_CAPSULE] = &BVHShapeCollider<OBBRSS, Capsule, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBBRSS][GEOM_CONE] = &BVHShapeCollider<OBBRSS, Cone, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBBRSS][GEOM_CYLINDER] = &BVHShapeCollider<OBBRSS, Cylinder, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBBRSS][GEOM_CONVEX] = &BVHShapeCollider<OBBRSS, Convex, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBBRSS][GEOM_PLANE] = &BVHShapeCollider<OBBRSS, Plane, NarrowPhaseSolver>::collide; - collision_matrix[BV_OBBRSS][GEOM_HALFSPACE] = &BVHShapeCollider<OBBRSS, Halfspace, NarrowPhaseSolver>::collide; - - collision_matrix[BV_AABB][BV_AABB] = &BVHCollide<AABB, NarrowPhaseSolver>; - collision_matrix[BV_OBB][BV_OBB] = &BVHCollide<OBB, NarrowPhaseSolver>; - collision_matrix[BV_RSS][BV_RSS] = &BVHCollide<RSS, NarrowPhaseSolver>; - collision_matrix[BV_KDOP16][BV_KDOP16] = &BVHCollide<KDOP<16>, NarrowPhaseSolver>; - collision_matrix[BV_KDOP18][BV_KDOP18] = &BVHCollide<KDOP<18>, NarrowPhaseSolver>; - collision_matrix[BV_KDOP24][BV_KDOP24] = &BVHCollide<KDOP<24>, NarrowPhaseSolver>; - collision_matrix[BV_kIOS][BV_kIOS] = &BVHCollide<kIOS, NarrowPhaseSolver>; - collision_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHCollide<OBBRSS, NarrowPhaseSolver>; + collision_matrix[GEOM_BOX][GEOM_BOX] = &ShapeShapeCollide<Box, Box, GJKSolver>; + collision_matrix[GEOM_BOX][GEOM_SPHERE] = &ShapeShapeCollide<Box, Sphere, GJKSolver>; + collision_matrix[GEOM_BOX][GEOM_CAPSULE] = &ShapeShapeCollide<Box, Capsule, GJKSolver>; + collision_matrix[GEOM_BOX][GEOM_CONE] = &ShapeShapeCollide<Box, Cone, GJKSolver>; + collision_matrix[GEOM_BOX][GEOM_CYLINDER] = &ShapeShapeCollide<Box, Cylinder, GJKSolver>; + collision_matrix[GEOM_BOX][GEOM_CONVEX] = &ShapeShapeCollide<Box, Convex, GJKSolver>; + collision_matrix[GEOM_BOX][GEOM_PLANE] = &ShapeShapeCollide<Box, Plane, GJKSolver>; + collision_matrix[GEOM_BOX][GEOM_HALFSPACE] = &ShapeShapeCollide<Box, Halfspace, GJKSolver>; + + collision_matrix[GEOM_SPHERE][GEOM_BOX] = &ShapeShapeCollide<Sphere, Box, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_SPHERE] = &ShapeShapeCollide<Sphere, Sphere, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_CAPSULE] = &ShapeShapeCollide<Sphere, Capsule, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_CONE] = &ShapeShapeCollide<Sphere, Cone, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_CYLINDER] = &ShapeShapeCollide<Sphere, Cylinder, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_CONVEX] = &ShapeShapeCollide<Sphere, Convex, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_PLANE] = &ShapeShapeCollide<Sphere, Plane, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_HALFSPACE] = &ShapeShapeCollide<Sphere, Halfspace, GJKSolver>; + + collision_matrix[GEOM_CAPSULE][GEOM_BOX] = &ShapeShapeCollide<Capsule, Box, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_SPHERE] = &ShapeShapeCollide<Capsule, Sphere, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_CAPSULE] = &ShapeShapeCollide<Capsule, Capsule, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_CONE] = &ShapeShapeCollide<Capsule, Cone, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_CYLINDER] = &ShapeShapeCollide<Capsule, Cylinder, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_CONVEX] = &ShapeShapeCollide<Capsule, Convex, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_PLANE] = &ShapeShapeCollide<Capsule, Plane, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_HALFSPACE] = &ShapeShapeCollide<Capsule, Halfspace, GJKSolver>; + + collision_matrix[GEOM_CONE][GEOM_BOX] = &ShapeShapeCollide<Cone, Box, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_SPHERE] = &ShapeShapeCollide<Cone, Sphere, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_CAPSULE] = &ShapeShapeCollide<Cone, Capsule, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_CONE] = &ShapeShapeCollide<Cone, Cone, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_CYLINDER] = &ShapeShapeCollide<Cone, Cylinder, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_CONVEX] = &ShapeShapeCollide<Cone, Convex, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_PLANE] = &ShapeShapeCollide<Cone, Plane, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_HALFSPACE] = &ShapeShapeCollide<Cone, Halfspace, GJKSolver>; + + collision_matrix[GEOM_CYLINDER][GEOM_BOX] = &ShapeShapeCollide<Cylinder, Box, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_SPHERE] = &ShapeShapeCollide<Cylinder, Sphere, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_CAPSULE] = &ShapeShapeCollide<Cylinder, Capsule, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_CONE] = &ShapeShapeCollide<Cylinder, Cone, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_CYLINDER] = &ShapeShapeCollide<Cylinder, Cylinder, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_CONVEX] = &ShapeShapeCollide<Cylinder, Convex, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_PLANE] = &ShapeShapeCollide<Cylinder, Plane, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_HALFSPACE] = &ShapeShapeCollide<Cylinder, Halfspace, GJKSolver>; + + collision_matrix[GEOM_CONVEX][GEOM_BOX] = &ShapeShapeCollide<Convex, Box, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_SPHERE] = &ShapeShapeCollide<Convex, Sphere, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_CAPSULE] = &ShapeShapeCollide<Convex, Capsule, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_CONE] = &ShapeShapeCollide<Convex, Cone, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_CYLINDER] = &ShapeShapeCollide<Convex, Cylinder, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_CONVEX] = &ShapeShapeCollide<Convex, Convex, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_PLANE] = &ShapeShapeCollide<Convex, Plane, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_HALFSPACE] = &ShapeShapeCollide<Convex, Halfspace, GJKSolver>; + + collision_matrix[GEOM_PLANE][GEOM_BOX] = &ShapeShapeCollide<Plane, Box, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_SPHERE] = &ShapeShapeCollide<Plane, Sphere, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_CAPSULE] = &ShapeShapeCollide<Plane, Capsule, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_CONE] = &ShapeShapeCollide<Plane, Cone, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_CYLINDER] = &ShapeShapeCollide<Plane, Cylinder, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_CONVEX] = &ShapeShapeCollide<Plane, Convex, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_PLANE] = &ShapeShapeCollide<Plane, Plane, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_HALFSPACE] = &ShapeShapeCollide<Plane, Halfspace, GJKSolver>; + + collision_matrix[GEOM_HALFSPACE][GEOM_BOX] = &ShapeShapeCollide<Halfspace, Box, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_SPHERE] = &ShapeShapeCollide<Halfspace, Sphere, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_CAPSULE] = &ShapeShapeCollide<Halfspace, Capsule, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_CONE] = &ShapeShapeCollide<Halfspace, Cone, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_CYLINDER] = &ShapeShapeCollide<Halfspace, Cylinder, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_CONVEX] = &ShapeShapeCollide<Halfspace, Convex, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_PLANE] = &ShapeShapeCollide<Halfspace, Plane, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeCollide<Halfspace, Halfspace, GJKSolver>; + + collision_matrix[BV_AABB][GEOM_BOX] = &BVHShapeCollider<AABB, Box, GJKSolver>::collide; + collision_matrix[BV_AABB][GEOM_SPHERE] = &BVHShapeCollider<AABB, Sphere, GJKSolver>::collide; + collision_matrix[BV_AABB][GEOM_CAPSULE] = &BVHShapeCollider<AABB, Capsule, GJKSolver>::collide; + collision_matrix[BV_AABB][GEOM_CONE] = &BVHShapeCollider<AABB, Cone, GJKSolver>::collide; + collision_matrix[BV_AABB][GEOM_CYLINDER] = &BVHShapeCollider<AABB, Cylinder, GJKSolver>::collide; + collision_matrix[BV_AABB][GEOM_CONVEX] = &BVHShapeCollider<AABB, Convex, GJKSolver>::collide; + collision_matrix[BV_AABB][GEOM_PLANE] = &BVHShapeCollider<AABB, Plane, GJKSolver>::collide; + collision_matrix[BV_AABB][GEOM_HALFSPACE] = &BVHShapeCollider<AABB, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_OBB][GEOM_BOX] = &BVHShapeCollider<OBB, Box, GJKSolver>::collide; + collision_matrix[BV_OBB][GEOM_SPHERE] = &BVHShapeCollider<OBB, Sphere, GJKSolver>::collide; + collision_matrix[BV_OBB][GEOM_CAPSULE] = &BVHShapeCollider<OBB, Capsule, GJKSolver>::collide; + collision_matrix[BV_OBB][GEOM_CONE] = &BVHShapeCollider<OBB, Cone, GJKSolver>::collide; + collision_matrix[BV_OBB][GEOM_CYLINDER] = &BVHShapeCollider<OBB, Cylinder, GJKSolver>::collide; + collision_matrix[BV_OBB][GEOM_CONVEX] = &BVHShapeCollider<OBB, Convex, GJKSolver>::collide; + collision_matrix[BV_OBB][GEOM_PLANE] = &BVHShapeCollider<OBB, Plane, GJKSolver>::collide; + collision_matrix[BV_OBB][GEOM_HALFSPACE] = &BVHShapeCollider<OBB, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_RSS][GEOM_BOX] = &BVHShapeCollider<RSS, Box, GJKSolver>::collide; + collision_matrix[BV_RSS][GEOM_SPHERE] = &BVHShapeCollider<RSS, Sphere, GJKSolver>::collide; + collision_matrix[BV_RSS][GEOM_CAPSULE] = &BVHShapeCollider<RSS, Capsule, GJKSolver>::collide; + collision_matrix[BV_RSS][GEOM_CONE] = &BVHShapeCollider<RSS, Cone, GJKSolver>::collide; + collision_matrix[BV_RSS][GEOM_CYLINDER] = &BVHShapeCollider<RSS, Cylinder, GJKSolver>::collide; + collision_matrix[BV_RSS][GEOM_CONVEX] = &BVHShapeCollider<RSS, Convex, GJKSolver>::collide; + collision_matrix[BV_RSS][GEOM_PLANE] = &BVHShapeCollider<RSS, Plane, GJKSolver>::collide; + collision_matrix[BV_RSS][GEOM_HALFSPACE] = &BVHShapeCollider<RSS, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_KDOP16][GEOM_BOX] = &BVHShapeCollider<KDOP<16>, Box, GJKSolver>::collide; + collision_matrix[BV_KDOP16][GEOM_SPHERE] = &BVHShapeCollider<KDOP<16>, Sphere, GJKSolver>::collide; + collision_matrix[BV_KDOP16][GEOM_CAPSULE] = &BVHShapeCollider<KDOP<16>, Capsule, GJKSolver>::collide; + collision_matrix[BV_KDOP16][GEOM_CONE] = &BVHShapeCollider<KDOP<16>, Cone, GJKSolver>::collide; + collision_matrix[BV_KDOP16][GEOM_CYLINDER] = &BVHShapeCollider<KDOP<16>, Cylinder, GJKSolver>::collide; + collision_matrix[BV_KDOP16][GEOM_CONVEX] = &BVHShapeCollider<KDOP<16>, Convex, GJKSolver>::collide; + collision_matrix[BV_KDOP16][GEOM_PLANE] = &BVHShapeCollider<KDOP<16>, Plane, GJKSolver>::collide; + collision_matrix[BV_KDOP16][GEOM_HALFSPACE] = &BVHShapeCollider<KDOP<16>, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_KDOP18][GEOM_BOX] = &BVHShapeCollider<KDOP<18>, Box, GJKSolver>::collide; + collision_matrix[BV_KDOP18][GEOM_SPHERE] = &BVHShapeCollider<KDOP<18>, Sphere, GJKSolver>::collide; + collision_matrix[BV_KDOP18][GEOM_CAPSULE] = &BVHShapeCollider<KDOP<18>, Capsule, GJKSolver>::collide; + collision_matrix[BV_KDOP18][GEOM_CONE] = &BVHShapeCollider<KDOP<18>, Cone, GJKSolver>::collide; + collision_matrix[BV_KDOP18][GEOM_CYLINDER] = &BVHShapeCollider<KDOP<18>, Cylinder, GJKSolver>::collide; + collision_matrix[BV_KDOP18][GEOM_CONVEX] = &BVHShapeCollider<KDOP<18>, Convex, GJKSolver>::collide; + collision_matrix[BV_KDOP18][GEOM_PLANE] = &BVHShapeCollider<KDOP<18>, Plane, GJKSolver>::collide; + collision_matrix[BV_KDOP18][GEOM_HALFSPACE] = &BVHShapeCollider<KDOP<18>, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_KDOP24][GEOM_BOX] = &BVHShapeCollider<KDOP<24>, Box, GJKSolver>::collide; + collision_matrix[BV_KDOP24][GEOM_SPHERE] = &BVHShapeCollider<KDOP<24>, Sphere, GJKSolver>::collide; + collision_matrix[BV_KDOP24][GEOM_CAPSULE] = &BVHShapeCollider<KDOP<24>, Capsule, GJKSolver>::collide; + collision_matrix[BV_KDOP24][GEOM_CONE] = &BVHShapeCollider<KDOP<24>, Cone, GJKSolver>::collide; + collision_matrix[BV_KDOP24][GEOM_CYLINDER] = &BVHShapeCollider<KDOP<24>, Cylinder, GJKSolver>::collide; + collision_matrix[BV_KDOP24][GEOM_CONVEX] = &BVHShapeCollider<KDOP<24>, Convex, GJKSolver>::collide; + collision_matrix[BV_KDOP24][GEOM_PLANE] = &BVHShapeCollider<KDOP<24>, Plane, GJKSolver>::collide; + collision_matrix[BV_KDOP24][GEOM_HALFSPACE] = &BVHShapeCollider<KDOP<24>, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_kIOS][GEOM_BOX] = &BVHShapeCollider<kIOS, Box, GJKSolver>::collide; + collision_matrix[BV_kIOS][GEOM_SPHERE] = &BVHShapeCollider<kIOS, Sphere, GJKSolver>::collide; + collision_matrix[BV_kIOS][GEOM_CAPSULE] = &BVHShapeCollider<kIOS, Capsule, GJKSolver>::collide; + collision_matrix[BV_kIOS][GEOM_CONE] = &BVHShapeCollider<kIOS, Cone, GJKSolver>::collide; + collision_matrix[BV_kIOS][GEOM_CYLINDER] = &BVHShapeCollider<kIOS, Cylinder, GJKSolver>::collide; + collision_matrix[BV_kIOS][GEOM_CONVEX] = &BVHShapeCollider<kIOS, Convex, GJKSolver>::collide; + collision_matrix[BV_kIOS][GEOM_PLANE] = &BVHShapeCollider<kIOS, Plane, GJKSolver>::collide; + collision_matrix[BV_kIOS][GEOM_HALFSPACE] = &BVHShapeCollider<kIOS, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_OBBRSS][GEOM_BOX] = &BVHShapeCollider<OBBRSS, Box, GJKSolver>::collide; + collision_matrix[BV_OBBRSS][GEOM_SPHERE] = &BVHShapeCollider<OBBRSS, Sphere, GJKSolver>::collide; + collision_matrix[BV_OBBRSS][GEOM_CAPSULE] = &BVHShapeCollider<OBBRSS, Capsule, GJKSolver>::collide; + collision_matrix[BV_OBBRSS][GEOM_CONE] = &BVHShapeCollider<OBBRSS, Cone, GJKSolver>::collide; + collision_matrix[BV_OBBRSS][GEOM_CYLINDER] = &BVHShapeCollider<OBBRSS, Cylinder, GJKSolver>::collide; + collision_matrix[BV_OBBRSS][GEOM_CONVEX] = &BVHShapeCollider<OBBRSS, Convex, GJKSolver>::collide; + collision_matrix[BV_OBBRSS][GEOM_PLANE] = &BVHShapeCollider<OBBRSS, Plane, GJKSolver>::collide; + collision_matrix[BV_OBBRSS][GEOM_HALFSPACE] = &BVHShapeCollider<OBBRSS, Halfspace, GJKSolver>::collide; + + collision_matrix[BV_AABB][BV_AABB] = &BVHCollide<AABB, GJKSolver>; + collision_matrix[BV_OBB][BV_OBB] = &BVHCollide<OBB, GJKSolver>; + collision_matrix[BV_RSS][BV_RSS] = &BVHCollide<RSS, GJKSolver>; + collision_matrix[BV_KDOP16][BV_KDOP16] = &BVHCollide<KDOP<16>, GJKSolver>; + collision_matrix[BV_KDOP18][BV_KDOP18] = &BVHCollide<KDOP<18>, GJKSolver>; + collision_matrix[BV_KDOP24][BV_KDOP24] = &BVHCollide<KDOP<24>, GJKSolver>; + collision_matrix[BV_kIOS][BV_kIOS] = &BVHCollide<kIOS, GJKSolver>; + collision_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHCollide<OBBRSS, GJKSolver>; #ifdef HPP_FCL_HAVE_OCTOMAP - collision_matrix[GEOM_OCTREE][GEOM_BOX] = &OcTreeShapeCollide<Box, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][GEOM_SPHERE] = &OcTreeShapeCollide<Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &OcTreeShapeCollide<Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][GEOM_CONE] = &OcTreeShapeCollide<Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][GEOM_CYLINDER] = &OcTreeShapeCollide<Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][GEOM_CONVEX] = &OcTreeShapeCollide<Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][GEOM_PLANE] = &OcTreeShapeCollide<Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][GEOM_HALFSPACE] = &OcTreeShapeCollide<Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_BOX][GEOM_OCTREE] = &ShapeOcTreeCollide<Box, NarrowPhaseSolver>; - collision_matrix[GEOM_SPHERE][GEOM_OCTREE] = &ShapeOcTreeCollide<Sphere, NarrowPhaseSolver>; - collision_matrix[GEOM_CAPSULE][GEOM_OCTREE] = &ShapeOcTreeCollide<Capsule, NarrowPhaseSolver>; - collision_matrix[GEOM_CONE][GEOM_OCTREE] = &ShapeOcTreeCollide<Cone, NarrowPhaseSolver>; - collision_matrix[GEOM_CYLINDER][GEOM_OCTREE] = &ShapeOcTreeCollide<Cylinder, NarrowPhaseSolver>; - collision_matrix[GEOM_CONVEX][GEOM_OCTREE] = &ShapeOcTreeCollide<Convex, NarrowPhaseSolver>; - collision_matrix[GEOM_PLANE][GEOM_OCTREE] = &ShapeOcTreeCollide<Plane, NarrowPhaseSolver>; - collision_matrix[GEOM_HALFSPACE][GEOM_OCTREE] = &ShapeOcTreeCollide<Halfspace, NarrowPhaseSolver>; - - collision_matrix[GEOM_OCTREE][GEOM_OCTREE] = &OcTreeCollide<NarrowPhaseSolver>; - - collision_matrix[GEOM_OCTREE][BV_AABB] = &OcTreeBVHCollide<AABB, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][BV_OBB] = &OcTreeBVHCollide<OBB, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][BV_RSS] = &OcTreeBVHCollide<RSS, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][BV_OBBRSS] = &OcTreeBVHCollide<OBBRSS, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][BV_kIOS] = &OcTreeBVHCollide<kIOS, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][BV_KDOP16] = &OcTreeBVHCollide<KDOP<16>, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][BV_KDOP18] = &OcTreeBVHCollide<KDOP<18>, NarrowPhaseSolver>; - collision_matrix[GEOM_OCTREE][BV_KDOP24] = &OcTreeBVHCollide<KDOP<24>, NarrowPhaseSolver>; - - collision_matrix[BV_AABB][GEOM_OCTREE] = &BVHOcTreeCollide<AABB, NarrowPhaseSolver>; - collision_matrix[BV_OBB][GEOM_OCTREE] = &BVHOcTreeCollide<OBB, NarrowPhaseSolver>; - collision_matrix[BV_RSS][GEOM_OCTREE] = &BVHOcTreeCollide<RSS, NarrowPhaseSolver>; - collision_matrix[BV_OBBRSS][GEOM_OCTREE] = &BVHOcTreeCollide<OBBRSS, NarrowPhaseSolver>; - collision_matrix[BV_kIOS][GEOM_OCTREE] = &BVHOcTreeCollide<kIOS, NarrowPhaseSolver>; - collision_matrix[BV_KDOP16][GEOM_OCTREE] = &BVHOcTreeCollide<KDOP<16>, NarrowPhaseSolver>; - collision_matrix[BV_KDOP18][GEOM_OCTREE] = &BVHOcTreeCollide<KDOP<18>, NarrowPhaseSolver>; - collision_matrix[BV_KDOP24][GEOM_OCTREE] = &BVHOcTreeCollide<KDOP<24>, NarrowPhaseSolver>; + collision_matrix[GEOM_OCTREE][GEOM_BOX] = &OcTreeShapeCollide<Box, GJKSolver>; + collision_matrix[GEOM_OCTREE][GEOM_SPHERE] = &OcTreeShapeCollide<Sphere, GJKSolver>; + collision_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &OcTreeShapeCollide<Capsule, GJKSolver>; + collision_matrix[GEOM_OCTREE][GEOM_CONE] = &OcTreeShapeCollide<Cone, GJKSolver>; + collision_matrix[GEOM_OCTREE][GEOM_CYLINDER] = &OcTreeShapeCollide<Cylinder, GJKSolver>; + collision_matrix[GEOM_OCTREE][GEOM_CONVEX] = &OcTreeShapeCollide<Convex, GJKSolver>; + collision_matrix[GEOM_OCTREE][GEOM_PLANE] = &OcTreeShapeCollide<Plane, GJKSolver>; + collision_matrix[GEOM_OCTREE][GEOM_HALFSPACE] = &OcTreeShapeCollide<Halfspace, GJKSolver>; + + collision_matrix[GEOM_BOX][GEOM_OCTREE] = &ShapeOcTreeCollide<Box, GJKSolver>; + collision_matrix[GEOM_SPHERE][GEOM_OCTREE] = &ShapeOcTreeCollide<Sphere, GJKSolver>; + collision_matrix[GEOM_CAPSULE][GEOM_OCTREE] = &ShapeOcTreeCollide<Capsule, GJKSolver>; + collision_matrix[GEOM_CONE][GEOM_OCTREE] = &ShapeOcTreeCollide<Cone, GJKSolver>; + collision_matrix[GEOM_CYLINDER][GEOM_OCTREE] = &ShapeOcTreeCollide<Cylinder, GJKSolver>; + collision_matrix[GEOM_CONVEX][GEOM_OCTREE] = &ShapeOcTreeCollide<Convex, GJKSolver>; + collision_matrix[GEOM_PLANE][GEOM_OCTREE] = &ShapeOcTreeCollide<Plane, GJKSolver>; + collision_matrix[GEOM_HALFSPACE][GEOM_OCTREE] = &ShapeOcTreeCollide<Halfspace, GJKSolver>; + + collision_matrix[GEOM_OCTREE][GEOM_OCTREE] = &OcTreeCollide<GJKSolver>; + + collision_matrix[GEOM_OCTREE][BV_AABB] = &OcTreeBVHCollide<AABB, GJKSolver>; + collision_matrix[GEOM_OCTREE][BV_OBB] = &OcTreeBVHCollide<OBB, GJKSolver>; + collision_matrix[GEOM_OCTREE][BV_RSS] = &OcTreeBVHCollide<RSS, GJKSolver>; + collision_matrix[GEOM_OCTREE][BV_OBBRSS] = &OcTreeBVHCollide<OBBRSS, GJKSolver>; + collision_matrix[GEOM_OCTREE][BV_kIOS] = &OcTreeBVHCollide<kIOS, GJKSolver>; + collision_matrix[GEOM_OCTREE][BV_KDOP16] = &OcTreeBVHCollide<KDOP<16>, GJKSolver>; + collision_matrix[GEOM_OCTREE][BV_KDOP18] = &OcTreeBVHCollide<KDOP<18>, GJKSolver>; + collision_matrix[GEOM_OCTREE][BV_KDOP24] = &OcTreeBVHCollide<KDOP<24>, GJKSolver>; + + collision_matrix[BV_AABB][GEOM_OCTREE] = &BVHOcTreeCollide<AABB, GJKSolver>; + collision_matrix[BV_OBB][GEOM_OCTREE] = &BVHOcTreeCollide<OBB, GJKSolver>; + collision_matrix[BV_RSS][GEOM_OCTREE] = &BVHOcTreeCollide<RSS, GJKSolver>; + collision_matrix[BV_OBBRSS][GEOM_OCTREE] = &BVHOcTreeCollide<OBBRSS, GJKSolver>; + collision_matrix[BV_kIOS][GEOM_OCTREE] = &BVHOcTreeCollide<kIOS, GJKSolver>; + collision_matrix[BV_KDOP16][GEOM_OCTREE] = &BVHOcTreeCollide<KDOP<16>, GJKSolver>; + collision_matrix[BV_KDOP18][GEOM_OCTREE] = &BVHOcTreeCollide<KDOP<18>, GJKSolver>; + collision_matrix[BV_KDOP24][GEOM_OCTREE] = &BVHOcTreeCollide<KDOP<24>, GJKSolver>; #endif } template struct CollisionFunctionMatrix<GJKSolver>; diff --git a/src/distance.cpp b/src/distance.cpp index b0acef0bedbbd4349e7f2ff56de4440530a162dd..41ae36ee8a122137f89d5857cbadcee2f648fbaa 100644 --- a/src/distance.cpp +++ b/src/distance.cpp @@ -53,25 +53,25 @@ DistanceFunctionMatrix<GJKSolver>& getDistanceFunctionLookTable() return table; } -template<typename NarrowPhaseSolver> -FCL_REAL distance(const CollisionObject* o1, const CollisionObject* o2, const NarrowPhaseSolver* nsolver, +template<typename GJKSolver> +FCL_REAL distance(const CollisionObject* o1, const CollisionObject* o2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { - return distance<NarrowPhaseSolver>(o1->collisionGeometry().get(), o1->getTransform(), o2->collisionGeometry().get(), o2->getTransform(), nsolver, + return distance<GJKSolver>(o1->collisionGeometry().get(), o1->getTransform(), o2->collisionGeometry().get(), o2->getTransform(), nsolver, request, result); } -template<typename NarrowPhaseSolver> +template<typename GJKSolver> FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver_, + const GJKSolver* nsolver_, const DistanceRequest& request, DistanceResult& result) { - const NarrowPhaseSolver* nsolver = nsolver_; + const GJKSolver* nsolver = nsolver_; if(!nsolver_) - nsolver = new NarrowPhaseSolver(); + nsolver = new GJKSolver(); - const DistanceFunctionMatrix<NarrowPhaseSolver>& looktable = getDistanceFunctionLookTable<NarrowPhaseSolver>(); + const DistanceFunctionMatrix<GJKSolver>& looktable = getDistanceFunctionLookTable<GJKSolver>(); OBJECT_TYPE object_type1 = o1->getObjectType(); NODE_TYPE node_type1 = o1->getNodeType(); diff --git a/src/distance_func_matrix.cpp b/src/distance_func_matrix.cpp index a2637a7a82f42f2b2eb0e5164b94dc6e79e5990f..832353bd73dd5b49d5deda9cf050b6ed54143edf 100644 --- a/src/distance_func_matrix.cpp +++ b/src/distance_func_matrix.cpp @@ -47,15 +47,15 @@ namespace fcl { #ifdef HPP_FCL_HAVE_OCTOMAP -template<typename T_SH, typename NarrowPhaseSolver> -FCL_REAL ShapeOcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, +template<typename T_SH, typename GJKSolver> +FCL_REAL ShapeOcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; - ShapeOcTreeDistanceTraversalNode<T_SH, NarrowPhaseSolver> node; + ShapeOcTreeDistanceTraversalNode<T_SH, GJKSolver> node; const T_SH* obj1 = static_cast<const T_SH*>(o1); const OcTree* obj2 = static_cast<const OcTree*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result); distance(&node); @@ -63,15 +63,15 @@ FCL_REAL ShapeOcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1 return result.min_distance; } -template<typename T_SH, typename NarrowPhaseSolver> -FCL_REAL OcTreeShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, +template<typename T_SH, typename GJKSolver> +FCL_REAL OcTreeShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; - OcTreeShapeDistanceTraversalNode<T_SH, NarrowPhaseSolver> node; + OcTreeShapeDistanceTraversalNode<T_SH, GJKSolver> node; const OcTree* obj1 = static_cast<const OcTree*>(o1); const T_SH* obj2 = static_cast<const T_SH*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result); distance(&node); @@ -79,15 +79,15 @@ FCL_REAL OcTreeShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1 return result.min_distance; } -template<typename NarrowPhaseSolver> -FCL_REAL OcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, +template<typename GJKSolver> +FCL_REAL OcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; - OcTreeDistanceTraversalNode<NarrowPhaseSolver> node; + OcTreeDistanceTraversalNode<GJKSolver> node; const OcTree* obj1 = static_cast<const OcTree*>(o1); const OcTree* obj2 = static_cast<const OcTree*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result); distance(&node); @@ -95,15 +95,15 @@ FCL_REAL OcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, con return result.min_distance; } -template<typename T_BVH, typename NarrowPhaseSolver> -FCL_REAL BVHOcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, +template<typename T_BVH, typename GJKSolver> +FCL_REAL BVHOcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; - MeshOcTreeDistanceTraversalNode<T_BVH, NarrowPhaseSolver> node; + MeshOcTreeDistanceTraversalNode<T_BVH, GJKSolver> node; const BVHModel<T_BVH>* obj1 = static_cast<const BVHModel<T_BVH>*>(o1); const OcTree* obj2 = static_cast<const OcTree*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result); distance(&node); @@ -111,15 +111,15 @@ FCL_REAL BVHOcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, return result.min_distance; } -template<typename T_BVH, typename NarrowPhaseSolver> -FCL_REAL OcTreeBVHDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, +template<typename T_BVH, typename GJKSolver> +FCL_REAL OcTreeBVHDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; - OcTreeMeshDistanceTraversalNode<T_BVH, NarrowPhaseSolver> node; + OcTreeMeshDistanceTraversalNode<T_BVH, GJKSolver> node; const OcTree* obj1 = static_cast<const OcTree*>(o1); const BVHModel<T_BVH>* obj2 = static_cast<const BVHModel<T_BVH>*>(o2); - OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver); + OcTreeSolver<GJKSolver> otsolver(nsolver); initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result); distance(&node); @@ -129,12 +129,12 @@ FCL_REAL OcTreeBVHDistance(const CollisionGeometry* o1, const Transform3f& tf1, #endif -template<typename T_SH1, typename T_SH2, typename NarrowPhaseSolver> -FCL_REAL ShapeShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, +template<typename T_SH1, typename T_SH2, typename GJKSolver> +FCL_REAL ShapeShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; - ShapeDistanceTraversalNode<T_SH1, T_SH2, NarrowPhaseSolver> node; + ShapeDistanceTraversalNode<T_SH1, T_SH2, GJKSolver> node; const T_SH1* obj1 = static_cast<const T_SH1*>(o1); const T_SH2* obj2 = static_cast<const T_SH2*>(o2); @@ -144,14 +144,14 @@ FCL_REAL ShapeShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1, return result.min_distance; } -template<typename T_BVH, typename T_SH, typename NarrowPhaseSolver> +template<typename T_BVH, typename T_SH, typename GJKSolver> struct BVHShapeDistancer { - static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, + static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; - MeshShapeDistanceTraversalNode<T_BVH, T_SH, NarrowPhaseSolver> node; + MeshShapeDistanceTraversalNode<T_BVH, T_SH, GJKSolver> node; const BVHModel<T_BVH>* obj1 = static_cast<const BVHModel<T_BVH>* >(o1); BVHModel<T_BVH>* obj1_tmp = new BVHModel<T_BVH>(*obj1); Transform3f tf1_tmp = tf1; @@ -168,8 +168,8 @@ struct BVHShapeDistancer namespace details { -template<typename OrientedMeshShapeDistanceTraversalNode, typename T_BVH, typename T_SH, typename NarrowPhaseSolver> -FCL_REAL orientedBVHShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, +template<typename OrientedMeshShapeDistanceTraversalNode, typename T_BVH, typename T_SH, typename GJKSolver> +FCL_REAL orientedBVHShapeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { if(request.isSatisfied(result)) return result.min_distance; @@ -185,34 +185,34 @@ FCL_REAL orientedBVHShapeDistance(const CollisionGeometry* o1, const Transform3f } -template<typename T_SH, typename NarrowPhaseSolver> -struct BVHShapeDistancer<RSS, T_SH, NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> +struct BVHShapeDistancer<RSS, T_SH, GJKSolver> { - static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, + static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { - return details::orientedBVHShapeDistance<MeshShapeDistanceTraversalNodeRSS<T_SH, NarrowPhaseSolver>, RSS, T_SH, NarrowPhaseSolver>(o1, tf1, o2, tf2, nsolver, request, result); + return details::orientedBVHShapeDistance<MeshShapeDistanceTraversalNodeRSS<T_SH, GJKSolver>, RSS, T_SH, GJKSolver>(o1, tf1, o2, tf2, nsolver, request, result); } }; -template<typename T_SH, typename NarrowPhaseSolver> -struct BVHShapeDistancer<kIOS, T_SH, NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> +struct BVHShapeDistancer<kIOS, T_SH, GJKSolver> { - static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, + static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { - return details::orientedBVHShapeDistance<MeshShapeDistanceTraversalNodekIOS<T_SH, NarrowPhaseSolver>, kIOS, T_SH, NarrowPhaseSolver>(o1, tf1, o2, tf2, nsolver, request, result); + return details::orientedBVHShapeDistance<MeshShapeDistanceTraversalNodekIOS<T_SH, GJKSolver>, kIOS, T_SH, GJKSolver>(o1, tf1, o2, tf2, nsolver, request, result); } }; -template<typename T_SH, typename NarrowPhaseSolver> -struct BVHShapeDistancer<OBBRSS, T_SH, NarrowPhaseSolver> +template<typename T_SH, typename GJKSolver> +struct BVHShapeDistancer<OBBRSS, T_SH, GJKSolver> { - static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, + static FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result) { - return details::orientedBVHShapeDistance<MeshShapeDistanceTraversalNodeOBBRSS<T_SH, NarrowPhaseSolver>, OBBRSS, T_SH, NarrowPhaseSolver>(o1, tf1, o2, tf2, nsolver, request, result); + return details::orientedBVHShapeDistance<MeshShapeDistanceTraversalNodeOBBRSS<T_SH, GJKSolver>, OBBRSS, T_SH, GJKSolver>(o1, tf1, o2, tf2, nsolver, request, result); } }; @@ -280,16 +280,16 @@ FCL_REAL BVHDistance<OBBRSS>(const CollisionGeometry* o1, const Transform3f& tf1 } -template<typename T_BVH, typename NarrowPhaseSolver> +template<typename T_BVH, typename GJKSolver> FCL_REAL BVHDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* /*nsolver*/, + const GJKSolver* /*nsolver*/, const DistanceRequest& request, DistanceResult& result) { return BVHDistance<T_BVH>(o1, tf1, o2, tf2, request, result); } -template<typename NarrowPhaseSolver> -DistanceFunctionMatrix<NarrowPhaseSolver>::DistanceFunctionMatrix() +template<typename GJKSolver> +DistanceFunctionMatrix<GJKSolver>::DistanceFunctionMatrix() { for(int i = 0; i < NODE_COUNT; ++i) { @@ -297,200 +297,200 @@ DistanceFunctionMatrix<NarrowPhaseSolver>::DistanceFunctionMatrix() distance_matrix[i][j] = NULL; } - distance_matrix[GEOM_BOX][GEOM_BOX] = &ShapeShapeDistance<Box, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_BOX][GEOM_SPHERE] = &ShapeShapeDistance<Box, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_BOX][GEOM_CAPSULE] = &ShapeShapeDistance<Box, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_BOX][GEOM_CONE] = &ShapeShapeDistance<Box, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_BOX][GEOM_CYLINDER] = &ShapeShapeDistance<Box, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_BOX][GEOM_CONVEX] = &ShapeShapeDistance<Box, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_BOX][GEOM_PLANE] = &ShapeShapeDistance<Box, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_BOX][GEOM_HALFSPACE] = &ShapeShapeDistance<Box, Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_SPHERE][GEOM_BOX] = &ShapeShapeDistance<Sphere, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_SPHERE] = &ShapeShapeDistance<Sphere, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_CAPSULE] = &ShapeShapeDistance<Sphere, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_CONE] = &ShapeShapeDistance<Sphere, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_CYLINDER] = &ShapeShapeDistance<Sphere, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_CONVEX] = &ShapeShapeDistance<Sphere, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_PLANE] = &ShapeShapeDistance<Sphere, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_HALFSPACE] = &ShapeShapeDistance<Sphere, Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_CAPSULE][GEOM_BOX] = &ShapeShapeDistance<Capsule, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_SPHERE] = &ShapeShapeDistance<Capsule, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_CAPSULE] = &ShapeShapeDistance<Capsule, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_CONE] = &ShapeShapeDistance<Capsule, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_CYLINDER] = &ShapeShapeDistance<Capsule, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_CONVEX] = &ShapeShapeDistance<Capsule, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_PLANE] = &ShapeShapeDistance<Capsule, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_HALFSPACE] = &ShapeShapeDistance<Capsule, Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_CONE][GEOM_BOX] = &ShapeShapeDistance<Cone, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_SPHERE] = &ShapeShapeDistance<Cone, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_CAPSULE] = &ShapeShapeDistance<Cone, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_CONE] = &ShapeShapeDistance<Cone, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_CYLINDER] = &ShapeShapeDistance<Cone, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_CONVEX] = &ShapeShapeDistance<Cone, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_PLANE] = &ShapeShapeDistance<Cone, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_HALFSPACE] = &ShapeShapeDistance<Cone, Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_CYLINDER][GEOM_BOX] = &ShapeShapeDistance<Cylinder, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_SPHERE] = &ShapeShapeDistance<Cylinder, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_CAPSULE] = &ShapeShapeDistance<Cylinder, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_CONE] = &ShapeShapeDistance<Cylinder, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_CYLINDER] = &ShapeShapeDistance<Cylinder, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_CONVEX] = &ShapeShapeDistance<Cylinder, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_PLANE] = &ShapeShapeDistance<Cylinder, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_HALFSPACE] = &ShapeShapeDistance<Cylinder, Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_CONVEX][GEOM_BOX] = &ShapeShapeDistance<Convex, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_SPHERE] = &ShapeShapeDistance<Convex, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_CAPSULE] = &ShapeShapeDistance<Convex, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_CONE] = &ShapeShapeDistance<Convex, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_CYLINDER] = &ShapeShapeDistance<Convex, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_CONVEX] = &ShapeShapeDistance<Convex, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_PLANE] = &ShapeShapeDistance<Convex, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_HALFSPACE] = &ShapeShapeDistance<Convex, Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_PLANE][GEOM_BOX] = &ShapeShapeDistance<Plane, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_SPHERE] = &ShapeShapeDistance<Plane, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_CAPSULE] = &ShapeShapeDistance<Plane, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_CONE] = &ShapeShapeDistance<Plane, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_CYLINDER] = &ShapeShapeDistance<Plane, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_CONVEX] = &ShapeShapeDistance<Plane, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_PLANE] = &ShapeShapeDistance<Plane, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_HALFSPACE] = &ShapeShapeDistance<Plane, Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_HALFSPACE][GEOM_BOX] = &ShapeShapeDistance<Halfspace, Box, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_SPHERE] = &ShapeShapeDistance<Halfspace, Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_CAPSULE] = &ShapeShapeDistance<Halfspace, Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_CONE] = &ShapeShapeDistance<Halfspace, Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_CYLINDER] = &ShapeShapeDistance<Halfspace, Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_CONVEX] = &ShapeShapeDistance<Halfspace, Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_PLANE] = &ShapeShapeDistance<Halfspace, Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeDistance<Halfspace, Halfspace, NarrowPhaseSolver>; + distance_matrix[GEOM_BOX][GEOM_BOX] = &ShapeShapeDistance<Box, Box, GJKSolver>; + distance_matrix[GEOM_BOX][GEOM_SPHERE] = &ShapeShapeDistance<Box, Sphere, GJKSolver>; + distance_matrix[GEOM_BOX][GEOM_CAPSULE] = &ShapeShapeDistance<Box, Capsule, GJKSolver>; + distance_matrix[GEOM_BOX][GEOM_CONE] = &ShapeShapeDistance<Box, Cone, GJKSolver>; + distance_matrix[GEOM_BOX][GEOM_CYLINDER] = &ShapeShapeDistance<Box, Cylinder, GJKSolver>; + distance_matrix[GEOM_BOX][GEOM_CONVEX] = &ShapeShapeDistance<Box, Convex, GJKSolver>; + distance_matrix[GEOM_BOX][GEOM_PLANE] = &ShapeShapeDistance<Box, Plane, GJKSolver>; + distance_matrix[GEOM_BOX][GEOM_HALFSPACE] = &ShapeShapeDistance<Box, Halfspace, GJKSolver>; + + distance_matrix[GEOM_SPHERE][GEOM_BOX] = &ShapeShapeDistance<Sphere, Box, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_SPHERE] = &ShapeShapeDistance<Sphere, Sphere, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_CAPSULE] = &ShapeShapeDistance<Sphere, Capsule, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_CONE] = &ShapeShapeDistance<Sphere, Cone, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_CYLINDER] = &ShapeShapeDistance<Sphere, Cylinder, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_CONVEX] = &ShapeShapeDistance<Sphere, Convex, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_PLANE] = &ShapeShapeDistance<Sphere, Plane, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_HALFSPACE] = &ShapeShapeDistance<Sphere, Halfspace, GJKSolver>; + + distance_matrix[GEOM_CAPSULE][GEOM_BOX] = &ShapeShapeDistance<Capsule, Box, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_SPHERE] = &ShapeShapeDistance<Capsule, Sphere, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_CAPSULE] = &ShapeShapeDistance<Capsule, Capsule, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_CONE] = &ShapeShapeDistance<Capsule, Cone, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_CYLINDER] = &ShapeShapeDistance<Capsule, Cylinder, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_CONVEX] = &ShapeShapeDistance<Capsule, Convex, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_PLANE] = &ShapeShapeDistance<Capsule, Plane, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_HALFSPACE] = &ShapeShapeDistance<Capsule, Halfspace, GJKSolver>; + + distance_matrix[GEOM_CONE][GEOM_BOX] = &ShapeShapeDistance<Cone, Box, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_SPHERE] = &ShapeShapeDistance<Cone, Sphere, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_CAPSULE] = &ShapeShapeDistance<Cone, Capsule, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_CONE] = &ShapeShapeDistance<Cone, Cone, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_CYLINDER] = &ShapeShapeDistance<Cone, Cylinder, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_CONVEX] = &ShapeShapeDistance<Cone, Convex, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_PLANE] = &ShapeShapeDistance<Cone, Plane, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_HALFSPACE] = &ShapeShapeDistance<Cone, Halfspace, GJKSolver>; + + distance_matrix[GEOM_CYLINDER][GEOM_BOX] = &ShapeShapeDistance<Cylinder, Box, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_SPHERE] = &ShapeShapeDistance<Cylinder, Sphere, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_CAPSULE] = &ShapeShapeDistance<Cylinder, Capsule, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_CONE] = &ShapeShapeDistance<Cylinder, Cone, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_CYLINDER] = &ShapeShapeDistance<Cylinder, Cylinder, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_CONVEX] = &ShapeShapeDistance<Cylinder, Convex, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_PLANE] = &ShapeShapeDistance<Cylinder, Plane, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_HALFSPACE] = &ShapeShapeDistance<Cylinder, Halfspace, GJKSolver>; + + distance_matrix[GEOM_CONVEX][GEOM_BOX] = &ShapeShapeDistance<Convex, Box, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_SPHERE] = &ShapeShapeDistance<Convex, Sphere, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_CAPSULE] = &ShapeShapeDistance<Convex, Capsule, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_CONE] = &ShapeShapeDistance<Convex, Cone, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_CYLINDER] = &ShapeShapeDistance<Convex, Cylinder, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_CONVEX] = &ShapeShapeDistance<Convex, Convex, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_PLANE] = &ShapeShapeDistance<Convex, Plane, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_HALFSPACE] = &ShapeShapeDistance<Convex, Halfspace, GJKSolver>; + + distance_matrix[GEOM_PLANE][GEOM_BOX] = &ShapeShapeDistance<Plane, Box, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_SPHERE] = &ShapeShapeDistance<Plane, Sphere, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_CAPSULE] = &ShapeShapeDistance<Plane, Capsule, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_CONE] = &ShapeShapeDistance<Plane, Cone, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_CYLINDER] = &ShapeShapeDistance<Plane, Cylinder, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_CONVEX] = &ShapeShapeDistance<Plane, Convex, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_PLANE] = &ShapeShapeDistance<Plane, Plane, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_HALFSPACE] = &ShapeShapeDistance<Plane, Halfspace, GJKSolver>; + + distance_matrix[GEOM_HALFSPACE][GEOM_BOX] = &ShapeShapeDistance<Halfspace, Box, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_SPHERE] = &ShapeShapeDistance<Halfspace, Sphere, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_CAPSULE] = &ShapeShapeDistance<Halfspace, Capsule, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_CONE] = &ShapeShapeDistance<Halfspace, Cone, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_CYLINDER] = &ShapeShapeDistance<Halfspace, Cylinder, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_CONVEX] = &ShapeShapeDistance<Halfspace, Convex, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_PLANE] = &ShapeShapeDistance<Halfspace, Plane, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeDistance<Halfspace, Halfspace, GJKSolver>; /* AABB distance not implemented */ /* - distance_matrix[BV_AABB][GEOM_BOX] = &BVHShapeDistancer<AABB, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_AABB][GEOM_SPHERE] = &BVHShapeDistancer<AABB, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_AABB][GEOM_CAPSULE] = &BVHShapeDistancer<AABB, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_AABB][GEOM_CONE] = &BVHShapeDistancer<AABB, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_AABB][GEOM_CYLINDER] = &BVHShapeDistancer<AABB, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_AABB][GEOM_CONVEX] = &BVHShapeDistancer<AABB, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_AABB][GEOM_PLANE] = &BVHShapeDistancer<AABB, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_AABB][GEOM_HALFSPACE] = &BVHShapeDistancer<AABB, Halfspace, NarrowPhaseSolver>::distance; + distance_matrix[BV_AABB][GEOM_BOX] = &BVHShapeDistancer<AABB, Box, GJKSolver>::distance; + distance_matrix[BV_AABB][GEOM_SPHERE] = &BVHShapeDistancer<AABB, Sphere, GJKSolver>::distance; + distance_matrix[BV_AABB][GEOM_CAPSULE] = &BVHShapeDistancer<AABB, Capsule, GJKSolver>::distance; + distance_matrix[BV_AABB][GEOM_CONE] = &BVHShapeDistancer<AABB, Cone, GJKSolver>::distance; + distance_matrix[BV_AABB][GEOM_CYLINDER] = &BVHShapeDistancer<AABB, Cylinder, GJKSolver>::distance; + distance_matrix[BV_AABB][GEOM_CONVEX] = &BVHShapeDistancer<AABB, Convex, GJKSolver>::distance; + distance_matrix[BV_AABB][GEOM_PLANE] = &BVHShapeDistancer<AABB, Plane, GJKSolver>::distance; + distance_matrix[BV_AABB][GEOM_HALFSPACE] = &BVHShapeDistancer<AABB, Halfspace, GJKSolver>::distance; */ - distance_matrix[BV_OBB][GEOM_BOX] = &BVHShapeDistancer<OBB, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBB][GEOM_SPHERE] = &BVHShapeDistancer<OBB, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBB][GEOM_CAPSULE] = &BVHShapeDistancer<OBB, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBB][GEOM_CONE] = &BVHShapeDistancer<OBB, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBB][GEOM_CYLINDER] = &BVHShapeDistancer<OBB, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBB][GEOM_CONVEX] = &BVHShapeDistancer<OBB, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBB][GEOM_PLANE] = &BVHShapeDistancer<OBB, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBB][GEOM_HALFSPACE] = &BVHShapeDistancer<OBB, Halfspace, NarrowPhaseSolver>::distance; - - distance_matrix[BV_RSS][GEOM_BOX] = &BVHShapeDistancer<RSS, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_RSS][GEOM_SPHERE] = &BVHShapeDistancer<RSS, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_RSS][GEOM_CAPSULE] = &BVHShapeDistancer<RSS, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_RSS][GEOM_CONE] = &BVHShapeDistancer<RSS, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_RSS][GEOM_CYLINDER] = &BVHShapeDistancer<RSS, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_RSS][GEOM_CONVEX] = &BVHShapeDistancer<RSS, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_RSS][GEOM_PLANE] = &BVHShapeDistancer<RSS, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_RSS][GEOM_HALFSPACE] = &BVHShapeDistancer<RSS, Halfspace, NarrowPhaseSolver>::distance; + distance_matrix[BV_OBB][GEOM_BOX] = &BVHShapeDistancer<OBB, Box, GJKSolver>::distance; + distance_matrix[BV_OBB][GEOM_SPHERE] = &BVHShapeDistancer<OBB, Sphere, GJKSolver>::distance; + distance_matrix[BV_OBB][GEOM_CAPSULE] = &BVHShapeDistancer<OBB, Capsule, GJKSolver>::distance; + distance_matrix[BV_OBB][GEOM_CONE] = &BVHShapeDistancer<OBB, Cone, GJKSolver>::distance; + distance_matrix[BV_OBB][GEOM_CYLINDER] = &BVHShapeDistancer<OBB, Cylinder, GJKSolver>::distance; + distance_matrix[BV_OBB][GEOM_CONVEX] = &BVHShapeDistancer<OBB, Convex, GJKSolver>::distance; + distance_matrix[BV_OBB][GEOM_PLANE] = &BVHShapeDistancer<OBB, Plane, GJKSolver>::distance; + distance_matrix[BV_OBB][GEOM_HALFSPACE] = &BVHShapeDistancer<OBB, Halfspace, GJKSolver>::distance; + + distance_matrix[BV_RSS][GEOM_BOX] = &BVHShapeDistancer<RSS, Box, GJKSolver>::distance; + distance_matrix[BV_RSS][GEOM_SPHERE] = &BVHShapeDistancer<RSS, Sphere, GJKSolver>::distance; + distance_matrix[BV_RSS][GEOM_CAPSULE] = &BVHShapeDistancer<RSS, Capsule, GJKSolver>::distance; + distance_matrix[BV_RSS][GEOM_CONE] = &BVHShapeDistancer<RSS, Cone, GJKSolver>::distance; + distance_matrix[BV_RSS][GEOM_CYLINDER] = &BVHShapeDistancer<RSS, Cylinder, GJKSolver>::distance; + distance_matrix[BV_RSS][GEOM_CONVEX] = &BVHShapeDistancer<RSS, Convex, GJKSolver>::distance; + distance_matrix[BV_RSS][GEOM_PLANE] = &BVHShapeDistancer<RSS, Plane, GJKSolver>::distance; + distance_matrix[BV_RSS][GEOM_HALFSPACE] = &BVHShapeDistancer<RSS, Halfspace, GJKSolver>::distance; /* KDOP distance not implemented */ /* - distance_matrix[BV_KDOP16][GEOM_BOX] = &BVHShapeDistancer<KDOP<16>, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP16][GEOM_SPHERE] = &BVHShapeDistancer<KDOP<16>, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP16][GEOM_CAPSULE] = &BVHShapeDistancer<KDOP<16>, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP16][GEOM_CONE] = &BVHShapeDistancer<KDOP<16>, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP16][GEOM_CYLINDER] = &BVHShapeDistancer<KDOP<16>, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP16][GEOM_CONVEX] = &BVHShapeDistancer<KDOP<16>, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP16][GEOM_PLANE] = &BVHShapeDistancer<KDOP<16>, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP16][GEOM_HALFSPACE] = &BVHShapeDistancer<KDOP<16>, Halfspace, NarrowPhaseSolver>::distance; - - distance_matrix[BV_KDOP18][GEOM_BOX] = &BVHShapeDistancer<KDOP<18>, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP18][GEOM_SPHERE] = &BVHShapeDistancer<KDOP<18>, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP18][GEOM_CAPSULE] = &BVHShapeDistancer<KDOP<18>, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP18][GEOM_CONE] = &BVHShapeDistancer<KDOP<18>, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP18][GEOM_CYLINDER] = &BVHShapeDistancer<KDOP<18>, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP18][GEOM_CONVEX] = &BVHShapeDistancer<KDOP<18>, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP18][GEOM_PLANE] = &BVHShapeDistancer<KDOP<18>, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP18][GEOM_HALFSPACE] = &BVHShapeDistancer<KDOP<18>, Halfspace, NarrowPhaseSolver>::distance; - - distance_matrix[BV_KDOP24][GEOM_BOX] = &BVHShapeDistancer<KDOP<24>, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP24][GEOM_SPHERE] = &BVHShapeDistancer<KDOP<24>, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP24][GEOM_CAPSULE] = &BVHShapeDistancer<KDOP<24>, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP24][GEOM_CONE] = &BVHShapeDistancer<KDOP<24>, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP24][GEOM_CYLINDER] = &BVHShapeDistancer<KDOP<24>, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP24][GEOM_CONVEX] = &BVHShapeDistancer<KDOP<24>, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP24][GEOM_PLANE] = &BVHShapeDistancer<KDOP<24>, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_KDOP24][GEOM_HALFSPACE] = &BVHShapeDistancer<KDOP<24>, Halfspace, NarrowPhaseSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_BOX] = &BVHShapeDistancer<KDOP<16>, Box, GJKSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_SPHERE] = &BVHShapeDistancer<KDOP<16>, Sphere, GJKSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_CAPSULE] = &BVHShapeDistancer<KDOP<16>, Capsule, GJKSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_CONE] = &BVHShapeDistancer<KDOP<16>, Cone, GJKSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_CYLINDER] = &BVHShapeDistancer<KDOP<16>, Cylinder, GJKSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_CONVEX] = &BVHShapeDistancer<KDOP<16>, Convex, GJKSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_PLANE] = &BVHShapeDistancer<KDOP<16>, Plane, GJKSolver>::distance; + distance_matrix[BV_KDOP16][GEOM_HALFSPACE] = &BVHShapeDistancer<KDOP<16>, Halfspace, GJKSolver>::distance; + + distance_matrix[BV_KDOP18][GEOM_BOX] = &BVHShapeDistancer<KDOP<18>, Box, GJKSolver>::distance; + distance_matrix[BV_KDOP18][GEOM_SPHERE] = &BVHShapeDistancer<KDOP<18>, Sphere, GJKSolver>::distance; + distance_matrix[BV_KDOP18][GEOM_CAPSULE] = &BVHShapeDistancer<KDOP<18>, Capsule, GJKSolver>::distance; + distance_matrix[BV_KDOP18][GEOM_CONE] = &BVHShapeDistancer<KDOP<18>, Cone, GJKSolver>::distance; + distance_matrix[BV_KDOP18][GEOM_CYLINDER] = &BVHShapeDistancer<KDOP<18>, Cylinder, GJKSolver>::distance; + distance_matrix[BV_KDOP18][GEOM_CONVEX] = &BVHShapeDistancer<KDOP<18>, Convex, GJKSolver>::distance; + distance_matrix[BV_KDOP18][GEOM_PLANE] = &BVHShapeDistancer<KDOP<18>, Plane, GJKSolver>::distance; + distance_matrix[BV_KDOP18][GEOM_HALFSPACE] = &BVHShapeDistancer<KDOP<18>, Halfspace, GJKSolver>::distance; + + distance_matrix[BV_KDOP24][GEOM_BOX] = &BVHShapeDistancer<KDOP<24>, Box, GJKSolver>::distance; + distance_matrix[BV_KDOP24][GEOM_SPHERE] = &BVHShapeDistancer<KDOP<24>, Sphere, GJKSolver>::distance; + distance_matrix[BV_KDOP24][GEOM_CAPSULE] = &BVHShapeDistancer<KDOP<24>, Capsule, GJKSolver>::distance; + distance_matrix[BV_KDOP24][GEOM_CONE] = &BVHShapeDistancer<KDOP<24>, Cone, GJKSolver>::distance; + distance_matrix[BV_KDOP24][GEOM_CYLINDER] = &BVHShapeDistancer<KDOP<24>, Cylinder, GJKSolver>::distance; + distance_matrix[BV_KDOP24][GEOM_CONVEX] = &BVHShapeDistancer<KDOP<24>, Convex, GJKSolver>::distance; + distance_matrix[BV_KDOP24][GEOM_PLANE] = &BVHShapeDistancer<KDOP<24>, Plane, GJKSolver>::distance; + distance_matrix[BV_KDOP24][GEOM_HALFSPACE] = &BVHShapeDistancer<KDOP<24>, Halfspace, GJKSolver>::distance; */ - distance_matrix[BV_kIOS][GEOM_BOX] = &BVHShapeDistancer<kIOS, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_kIOS][GEOM_SPHERE] = &BVHShapeDistancer<kIOS, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_kIOS][GEOM_CAPSULE] = &BVHShapeDistancer<kIOS, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_kIOS][GEOM_CONE] = &BVHShapeDistancer<kIOS, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_kIOS][GEOM_CYLINDER] = &BVHShapeDistancer<kIOS, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_kIOS][GEOM_CONVEX] = &BVHShapeDistancer<kIOS, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_kIOS][GEOM_PLANE] = &BVHShapeDistancer<kIOS, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_kIOS][GEOM_HALFSPACE] = &BVHShapeDistancer<kIOS, Halfspace, NarrowPhaseSolver>::distance; - - distance_matrix[BV_OBBRSS][GEOM_BOX] = &BVHShapeDistancer<OBBRSS, Box, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBBRSS][GEOM_SPHERE] = &BVHShapeDistancer<OBBRSS, Sphere, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBBRSS][GEOM_CAPSULE] = &BVHShapeDistancer<OBBRSS, Capsule, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBBRSS][GEOM_CONE] = &BVHShapeDistancer<OBBRSS, Cone, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBBRSS][GEOM_CYLINDER] = &BVHShapeDistancer<OBBRSS, Cylinder, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBBRSS][GEOM_CONVEX] = &BVHShapeDistancer<OBBRSS, Convex, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBBRSS][GEOM_PLANE] = &BVHShapeDistancer<OBBRSS, Plane, NarrowPhaseSolver>::distance; - distance_matrix[BV_OBBRSS][GEOM_HALFSPACE] = &BVHShapeDistancer<OBBRSS, Halfspace, NarrowPhaseSolver>::distance; - - distance_matrix[BV_AABB][BV_AABB] = &BVHDistance<AABB, NarrowPhaseSolver>; - distance_matrix[BV_OBB][BV_OBB] = &BVHDistance<OBB, NarrowPhaseSolver>; - distance_matrix[BV_RSS][BV_RSS] = &BVHDistance<RSS, NarrowPhaseSolver>; - distance_matrix[BV_kIOS][BV_kIOS] = &BVHDistance<kIOS, NarrowPhaseSolver>; - distance_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHDistance<OBBRSS, NarrowPhaseSolver>; + distance_matrix[BV_kIOS][GEOM_BOX] = &BVHShapeDistancer<kIOS, Box, GJKSolver>::distance; + distance_matrix[BV_kIOS][GEOM_SPHERE] = &BVHShapeDistancer<kIOS, Sphere, GJKSolver>::distance; + distance_matrix[BV_kIOS][GEOM_CAPSULE] = &BVHShapeDistancer<kIOS, Capsule, GJKSolver>::distance; + distance_matrix[BV_kIOS][GEOM_CONE] = &BVHShapeDistancer<kIOS, Cone, GJKSolver>::distance; + distance_matrix[BV_kIOS][GEOM_CYLINDER] = &BVHShapeDistancer<kIOS, Cylinder, GJKSolver>::distance; + distance_matrix[BV_kIOS][GEOM_CONVEX] = &BVHShapeDistancer<kIOS, Convex, GJKSolver>::distance; + distance_matrix[BV_kIOS][GEOM_PLANE] = &BVHShapeDistancer<kIOS, Plane, GJKSolver>::distance; + distance_matrix[BV_kIOS][GEOM_HALFSPACE] = &BVHShapeDistancer<kIOS, Halfspace, GJKSolver>::distance; + + distance_matrix[BV_OBBRSS][GEOM_BOX] = &BVHShapeDistancer<OBBRSS, Box, GJKSolver>::distance; + distance_matrix[BV_OBBRSS][GEOM_SPHERE] = &BVHShapeDistancer<OBBRSS, Sphere, GJKSolver>::distance; + distance_matrix[BV_OBBRSS][GEOM_CAPSULE] = &BVHShapeDistancer<OBBRSS, Capsule, GJKSolver>::distance; + distance_matrix[BV_OBBRSS][GEOM_CONE] = &BVHShapeDistancer<OBBRSS, Cone, GJKSolver>::distance; + distance_matrix[BV_OBBRSS][GEOM_CYLINDER] = &BVHShapeDistancer<OBBRSS, Cylinder, GJKSolver>::distance; + distance_matrix[BV_OBBRSS][GEOM_CONVEX] = &BVHShapeDistancer<OBBRSS, Convex, GJKSolver>::distance; + distance_matrix[BV_OBBRSS][GEOM_PLANE] = &BVHShapeDistancer<OBBRSS, Plane, GJKSolver>::distance; + distance_matrix[BV_OBBRSS][GEOM_HALFSPACE] = &BVHShapeDistancer<OBBRSS, Halfspace, GJKSolver>::distance; + + distance_matrix[BV_AABB][BV_AABB] = &BVHDistance<AABB, GJKSolver>; + distance_matrix[BV_OBB][BV_OBB] = &BVHDistance<OBB, GJKSolver>; + distance_matrix[BV_RSS][BV_RSS] = &BVHDistance<RSS, GJKSolver>; + distance_matrix[BV_kIOS][BV_kIOS] = &BVHDistance<kIOS, GJKSolver>; + distance_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHDistance<OBBRSS, GJKSolver>; #ifdef HPP_FCL_HAVE_OCTOMAP - distance_matrix[GEOM_OCTREE][GEOM_BOX] = &OcTreeShapeDistance<Box, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][GEOM_SPHERE] = &OcTreeShapeDistance<Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &OcTreeShapeDistance<Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][GEOM_CONE] = &OcTreeShapeDistance<Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][GEOM_CYLINDER] = &OcTreeShapeDistance<Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][GEOM_CONVEX] = &OcTreeShapeDistance<Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][GEOM_PLANE] = &OcTreeShapeDistance<Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][GEOM_HALFSPACE] = &OcTreeShapeDistance<Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_BOX][GEOM_OCTREE] = &ShapeOcTreeDistance<Box, NarrowPhaseSolver>; - distance_matrix[GEOM_SPHERE][GEOM_OCTREE] = &ShapeOcTreeDistance<Sphere, NarrowPhaseSolver>; - distance_matrix[GEOM_CAPSULE][GEOM_OCTREE] = &ShapeOcTreeDistance<Capsule, NarrowPhaseSolver>; - distance_matrix[GEOM_CONE][GEOM_OCTREE] = &ShapeOcTreeDistance<Cone, NarrowPhaseSolver>; - distance_matrix[GEOM_CYLINDER][GEOM_OCTREE] = &ShapeOcTreeDistance<Cylinder, NarrowPhaseSolver>; - distance_matrix[GEOM_CONVEX][GEOM_OCTREE] = &ShapeOcTreeDistance<Convex, NarrowPhaseSolver>; - distance_matrix[GEOM_PLANE][GEOM_OCTREE] = &ShapeOcTreeDistance<Plane, NarrowPhaseSolver>; - distance_matrix[GEOM_HALFSPACE][GEOM_OCTREE] = &ShapeOcTreeDistance<Halfspace, NarrowPhaseSolver>; - - distance_matrix[GEOM_OCTREE][GEOM_OCTREE] = &OcTreeDistance<NarrowPhaseSolver>; - - distance_matrix[GEOM_OCTREE][BV_AABB] = &OcTreeBVHDistance<AABB, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][BV_OBB] = &OcTreeBVHDistance<OBB, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][BV_RSS] = &OcTreeBVHDistance<RSS, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][BV_OBBRSS] = &OcTreeBVHDistance<OBBRSS, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][BV_kIOS] = &OcTreeBVHDistance<kIOS, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][BV_KDOP16] = &OcTreeBVHDistance<KDOP<16>, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][BV_KDOP18] = &OcTreeBVHDistance<KDOP<18>, NarrowPhaseSolver>; - distance_matrix[GEOM_OCTREE][BV_KDOP24] = &OcTreeBVHDistance<KDOP<24>, NarrowPhaseSolver>; - - distance_matrix[BV_AABB][GEOM_OCTREE] = &BVHOcTreeDistance<AABB, NarrowPhaseSolver>; - distance_matrix[BV_OBB][GEOM_OCTREE] = &BVHOcTreeDistance<OBB, NarrowPhaseSolver>; - distance_matrix[BV_RSS][GEOM_OCTREE] = &BVHOcTreeDistance<RSS, NarrowPhaseSolver>; - distance_matrix[BV_OBBRSS][GEOM_OCTREE] = &BVHOcTreeDistance<OBBRSS, NarrowPhaseSolver>; - distance_matrix[BV_kIOS][GEOM_OCTREE] = &BVHOcTreeDistance<kIOS, NarrowPhaseSolver>; - distance_matrix[BV_KDOP16][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<16>, NarrowPhaseSolver>; - distance_matrix[BV_KDOP18][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<18>, NarrowPhaseSolver>; - distance_matrix[BV_KDOP24][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<24>, NarrowPhaseSolver>; + distance_matrix[GEOM_OCTREE][GEOM_BOX] = &OcTreeShapeDistance<Box, GJKSolver>; + distance_matrix[GEOM_OCTREE][GEOM_SPHERE] = &OcTreeShapeDistance<Sphere, GJKSolver>; + distance_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &OcTreeShapeDistance<Capsule, GJKSolver>; + distance_matrix[GEOM_OCTREE][GEOM_CONE] = &OcTreeShapeDistance<Cone, GJKSolver>; + distance_matrix[GEOM_OCTREE][GEOM_CYLINDER] = &OcTreeShapeDistance<Cylinder, GJKSolver>; + distance_matrix[GEOM_OCTREE][GEOM_CONVEX] = &OcTreeShapeDistance<Convex, GJKSolver>; + distance_matrix[GEOM_OCTREE][GEOM_PLANE] = &OcTreeShapeDistance<Plane, GJKSolver>; + distance_matrix[GEOM_OCTREE][GEOM_HALFSPACE] = &OcTreeShapeDistance<Halfspace, GJKSolver>; + + distance_matrix[GEOM_BOX][GEOM_OCTREE] = &ShapeOcTreeDistance<Box, GJKSolver>; + distance_matrix[GEOM_SPHERE][GEOM_OCTREE] = &ShapeOcTreeDistance<Sphere, GJKSolver>; + distance_matrix[GEOM_CAPSULE][GEOM_OCTREE] = &ShapeOcTreeDistance<Capsule, GJKSolver>; + distance_matrix[GEOM_CONE][GEOM_OCTREE] = &ShapeOcTreeDistance<Cone, GJKSolver>; + distance_matrix[GEOM_CYLINDER][GEOM_OCTREE] = &ShapeOcTreeDistance<Cylinder, GJKSolver>; + distance_matrix[GEOM_CONVEX][GEOM_OCTREE] = &ShapeOcTreeDistance<Convex, GJKSolver>; + distance_matrix[GEOM_PLANE][GEOM_OCTREE] = &ShapeOcTreeDistance<Plane, GJKSolver>; + distance_matrix[GEOM_HALFSPACE][GEOM_OCTREE] = &ShapeOcTreeDistance<Halfspace, GJKSolver>; + + distance_matrix[GEOM_OCTREE][GEOM_OCTREE] = &OcTreeDistance<GJKSolver>; + + distance_matrix[GEOM_OCTREE][BV_AABB] = &OcTreeBVHDistance<AABB, GJKSolver>; + distance_matrix[GEOM_OCTREE][BV_OBB] = &OcTreeBVHDistance<OBB, GJKSolver>; + distance_matrix[GEOM_OCTREE][BV_RSS] = &OcTreeBVHDistance<RSS, GJKSolver>; + distance_matrix[GEOM_OCTREE][BV_OBBRSS] = &OcTreeBVHDistance<OBBRSS, GJKSolver>; + distance_matrix[GEOM_OCTREE][BV_kIOS] = &OcTreeBVHDistance<kIOS, GJKSolver>; + distance_matrix[GEOM_OCTREE][BV_KDOP16] = &OcTreeBVHDistance<KDOP<16>, GJKSolver>; + distance_matrix[GEOM_OCTREE][BV_KDOP18] = &OcTreeBVHDistance<KDOP<18>, GJKSolver>; + distance_matrix[GEOM_OCTREE][BV_KDOP24] = &OcTreeBVHDistance<KDOP<24>, GJKSolver>; + + distance_matrix[BV_AABB][GEOM_OCTREE] = &BVHOcTreeDistance<AABB, GJKSolver>; + distance_matrix[BV_OBB][GEOM_OCTREE] = &BVHOcTreeDistance<OBB, GJKSolver>; + distance_matrix[BV_RSS][GEOM_OCTREE] = &BVHOcTreeDistance<RSS, GJKSolver>; + distance_matrix[BV_OBBRSS][GEOM_OCTREE] = &BVHOcTreeDistance<OBBRSS, GJKSolver>; + distance_matrix[BV_kIOS][GEOM_OCTREE] = &BVHOcTreeDistance<kIOS, GJKSolver>; + distance_matrix[BV_KDOP16][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<16>, GJKSolver>; + distance_matrix[BV_KDOP18][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<18>, GJKSolver>; + distance_matrix[BV_KDOP24][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<24>, GJKSolver>; #endif diff --git a/src/distance_func_matrix.h b/src/distance_func_matrix.h index 5cb194384daf982f891d858de1297038277673ba..97e90780a3ff7dee186b91928b6a609e71fbcfea 100644 --- a/src/distance_func_matrix.h +++ b/src/distance_func_matrix.h @@ -39,18 +39,18 @@ namespace hpp { namespace fcl { - template<typename T_SH1, typename T_SH2, typename NarrowPhaseSolver> + template<typename T_SH1, typename T_SH2, typename GJKSolver> FCL_REAL ShapeShapeDistance (const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, const DistanceRequest& request, + const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result); - template<typename T_SH1, typename T_SH2, typename NarrowPhaseSolver> + template<typename T_SH1, typename T_SH2, typename GJKSolver> std::size_t ShapeShapeCollide (const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, - const NarrowPhaseSolver* nsolver, const CollisionRequest& request, + const GJKSolver* nsolver, const CollisionRequest& request, CollisionResult& result); } diff --git a/src/intersect.cpp b/src/intersect.cpp index a69343de864f491a98cb51a43639f7af61e1ac0a..15df43fc3432f1245e75ac21d84e5291b4bd72fa 100644 --- a/src/intersect.cpp +++ b/src/intersect.cpp @@ -40,7 +40,7 @@ #include <limits> #include <vector> #include <boost/math/special_functions/fpclassify.hpp> -#include <hpp/fcl/math/tools.h> +#include "math/tools.h" namespace hpp { diff --git a/include/hpp/fcl/math/tools.h b/src/math/tools.h similarity index 100% rename from include/hpp/fcl/math/tools.h rename to src/math/tools.h diff --git a/src/narrowphase/gjk.cpp b/src/narrowphase/gjk.cpp index fa37055895d3843d2210fe093714782e94437ee5..54393566d0b73cfc2fe548c6be4aeb8cf204654a 100644 --- a/src/narrowphase/gjk.cpp +++ b/src/narrowphase/gjk.cpp @@ -37,7 +37,7 @@ #include <hpp/fcl/narrowphase/gjk.h> #include <hpp/fcl/intersect.h> -#include <hpp/fcl/math/tools.h> +#include "../math/tools.h" namespace hpp { diff --git a/src/shape/geometric_shapes_utility.cpp b/src/shape/geometric_shapes_utility.cpp index d0f1825c670082c990a0ec7265209852e1e7cad1..70f26152604a39f76e543f1aa4f8fb0b1900201f 100644 --- a/src/shape/geometric_shapes_utility.cpp +++ b/src/shape/geometric_shapes_utility.cpp @@ -38,7 +38,7 @@ #include <hpp/fcl/shape/geometric_shapes_utility.h> #include <hpp/fcl/BVH/BV_fitter.h> -#include <hpp/fcl/math/tools.h> +#include "../math/tools.h" namespace hpp { diff --git a/src/traversal/traversal_node_setup.cpp b/src/traversal/traversal_node_setup.cpp index 9f236985d0501ee4f93748369c0c870ac4b31f92..9f3f6d85af31e329b689445fd24f6e599ddcb427 100644 --- a/src/traversal/traversal_node_setup.cpp +++ b/src/traversal/traversal_node_setup.cpp @@ -37,7 +37,7 @@ #include <hpp/fcl/traversal/traversal_node_setup.h> -#include <hpp/fcl/math/tools.h> +#include "../math/tools.h" namespace hpp { diff --git a/test/geometric_shapes.cpp b/test/geometric_shapes.cpp index e65aad57e4ad143f95d317f53a33a03e07c9e7e4..6b3474ac8d7358ee184ec37b920a6f608918ed66 100644 --- a/test/geometric_shapes.cpp +++ b/test/geometric_shapes.cpp @@ -46,7 +46,7 @@ #include <hpp/fcl/distance.h> #include "utility.h" #include <iostream> -#include <hpp/fcl/math/tools.h> +#include "../src/math/tools.h" using namespace hpp::fcl; diff --git a/test/gjk.cpp b/test/gjk.cpp index 9ae852de0587454b24d7a968fe1532b7fd9bcc69..b02436d16a301d9df43b52e28c60333cfc931165 100644 --- a/test/gjk.cpp +++ b/test/gjk.cpp @@ -43,7 +43,7 @@ #include <hpp/fcl/narrowphase/narrowphase.h> #include <hpp/fcl/shape/geometric_shapes.h> -#include <hpp/fcl/math/tools.h> +#include "../src/math/tools.h" using hpp::fcl::GJKSolver; using hpp::fcl::TriangleP; diff --git a/test/math.cpp b/test/math.cpp index ef7d49c2b42b5aca845b5a15fb3858b15c961e1b..33845b0a73196805496f3e4591e3ad6dc84752b4 100644 --- a/test/math.cpp +++ b/test/math.cpp @@ -43,7 +43,7 @@ #include <hpp/fcl/math/transform.h> #include <hpp/fcl/intersect.h> -#include <hpp/fcl/math/tools.h> +#include "../src/math/tools.h" using namespace hpp::fcl;