Commit 0aa5da29 by Joseph Mirabel

### Add collision and distance between ConvexBase and Halfspace.

parent a843f920
 ... ... @@ -65,6 +65,8 @@ set(\${LIBRARY_NAME}_SOURCES distance/sphere_cylinder.cpp distance/sphere_halfspace.cpp distance/sphere_plane.cpp distance/convex_halfspace.cpp distance/triangle_halfspace.cpp intersect.cpp math/transform.cpp traversal/traversal_recurse.cpp ... ...
 ... ... @@ -89,6 +89,9 @@ HPP_FCL_DLLAPI FCL_REAL ShapeShapeDistance \ SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere,Sphere); SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere,Cylinder); SHAPE_SHAPE_DISTANCE_SPECIALIZATION(ConvexBase, Halfspace); SHAPE_SHAPE_DISTANCE_SPECIALIZATION(TriangleP, Halfspace); #undef SHAPE_SHAPE_DISTANCE_SPECIALIZATION #define SHAPE_SHAPE_COLLIDE_SPECIALIZATION(T1,T2) \ ... ...
 ... ... @@ -1942,6 +1942,29 @@ namespace fcl { return true; } /// @param p1 closest (or most penetrating) point on the Halfspace, /// @param p2 closest (or most penetrating) point on the shape, /// @param normal the halfspace normal. /// @return true if the distance is negative (the shape overlaps). inline bool halfspaceDistance(const Halfspace& h, const Transform3f& tf1, const ShapeBase& s, const Transform3f& tf2, FCL_REAL& dist, Vec3f& p1, Vec3f& p2, Vec3f& normal) { Vec3f n_w = tf1.getRotation() * h.n; Vec3f n_2 (tf2.getRotation().transpose() * n_w); int hint = 0; p2 = getSupport(&s, -n_2, true, hint); dist = p2.dot(n_2) - h.d; p1 = p2 - dist * n_2; p1 = tf2.transform(p1); p2 = tf2.transform(p2); normal = n_w; return dist <= 0; } template inline T planeIntersectTolerance() { ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!