Skip to content
Snippets Groups Projects
Commit 665f554f authored by jpan's avatar jpan
Browse files

More special optimization for sphere and box

git-svn-id: https://kforge.ros.org/fcl/fcl_ros@108 253336fb-580f-4252-a368-f3cef5a2a82b
parent 008dd1dc
No related branches found
No related tags found
No related merge requests found
......@@ -192,31 +192,46 @@ struct GJKSolver_libccd
};
/** \brief Fast implementation for sphere-sphere collision */
template<>
bool GJKSolver_libccd::shapeIntersect<Sphere, Sphere>(const Sphere& s1, const SimpleTransform& tf1,
const Sphere& s2, const SimpleTransform& tf2,
Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
/*
/** \brief Fast implementation for sphere-triangle collision */
template<>
bool GJKSolver_libccd::shapeTriangleIntersect(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3, Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
/** \brief Fast implementation for sphere-triangle collision */
template<>
bool GJKSolver_libccd::shapeTriangleIntersect(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3, const Matrix3f& R, const Vec3f& T, Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
/** \brief Fast implementation for sphere-sphere distance */
template<>
bool GJKSolver_libccd::shapeDistance<Sphere, Sphere>(const Sphere& s1, const SimpleTransform& tf1,
const Sphere& s2, const SimpleTransform& tf2,
BVH_REAL* dist) const;
/** \brief Fast implementation for sphere-triangle distance */
template<>
bool GJKSolver_libccd::shapeTriangleDistance<Sphere>(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3,
BVH_REAL* dist) const;
/** \brief Fast implementation for sphere-triangle distance */
template<>
bool GJKSolver_libccd::shapeTriangleDistance<Sphere>(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3, const Matrix3f& R, const Vec3f& T,
BVH_REAL* dist) const;
/** \brief Fast implementation for box-box collision */
template<>
bool GJKSolver_libccd::shapeIntersect<Box, Box>(const Box& s1, const SimpleTransform& tf1,
const Box& s2, const SimpleTransform& tf2,
Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
*/
template<>
bool GJKSolver_libccd::shapeDistance<Sphere, Sphere>(const Sphere& s1, const SimpleTransform& tf1,
const Sphere& s2, const SimpleTransform& tf2,
BVH_REAL* dist) const;
struct GJKSolver_indep
{
......@@ -478,23 +493,46 @@ struct GJKSolver_indep
BVH_REAL gjk_max_iterations;
};
/** \brief Fast implementation for sphere-sphere collision */
template<>
bool GJKSolver_indep::shapeIntersect<Sphere, Sphere>(const Sphere& s1, const SimpleTransform& tf1,
const Sphere& s2, const SimpleTransform& tf2,
Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
/*
template<>
bool GJKSolver_indep::shapeIntersect<Box, Box>(const Box& s1, const SimpleTransform& tf1,
const Box& s2, const SimpleTransform& tf2,
Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
*/
/** \brief Fast implementation for sphere-triangle collision */
template<>
bool GJKSolver_indep::shapeTriangleIntersect(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3, Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
/** \brief Fast implementation for sphere-triangle collision */
template<>
bool GJKSolver_indep::shapeTriangleIntersect(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3, const Matrix3f& R, const Vec3f& T, Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
/** \brief Fast implementation for sphere-sphere distance */
template<>
bool GJKSolver_indep::shapeDistance<Sphere, Sphere>(const Sphere& s1, const SimpleTransform& tf1,
const Sphere& s2, const SimpleTransform& tf2,
BVH_REAL* dist) const;
/** \brief Fast implementation for sphere-triangle distance */
template<>
bool GJKSolver_indep::shapeTriangleDistance<Sphere>(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3,
BVH_REAL* dist) const;
/** \brief Fast implementation for sphere-triangle distance */
template<>
bool GJKSolver_indep::shapeTriangleDistance<Sphere>(const Sphere& s, const SimpleTransform& tf,
const Vec3f& P1, const Vec3f& P2, const Vec3f& P3, const Matrix3f& R, const Vec3f& T,
BVH_REAL* dist) const;
/** \brief Fast implementation for box-box collision */
template<>
bool GJKSolver_indep::shapeIntersect<Box, Box>(const Box& s1, const SimpleTransform& tf1,
const Box& s2, const SimpleTransform& tf2,
Vec3f* contact_points, BVH_REAL* penetration_depth, Vec3f* normal) const;
}
#endif
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment