@@ -801,16 +801,14 @@ void getShapeSupportSetLinear(const ConvexBase* convex, SupportSet& support_set,
801
801
const Vec3f& support_dir = support_set.getNormal ();
802
802
getShapeSupport<SupportOptions::NoSweptSphere>(convex, support_dir, support,
803
803
hint, support_data);
804
- const FCL_REAL support_value = support .dot (support_dir );
804
+ const FCL_REAL support_value = support_dir .dot (support );
805
805
806
806
const std::vector<Vec3f>& points = *(convex->points );
807
- assert (points.size () == (size_t )(convex->num_points ));
808
- hint = 0 ;
809
807
support_data.support_set .points ().clear ();
810
808
support_data.support_set .direction = support_set.direction ;
811
809
support_data.support_set .tf = support_set.tf ;
812
- for (const auto & point : points) {
813
- FCL_REAL dot = point .dot (support_dir );
810
+ for (const Vec3f & point : points) {
811
+ const FCL_REAL dot = support_dir .dot (point );
814
812
if (support_value - dot <= tol) {
815
813
if (_SupportOptions == SupportOptions::WithSweptSphere) {
816
814
support_data.support_set .addPoint (
@@ -930,6 +928,11 @@ HPP_FCL_DLLAPI void computeSupportSetConvexHull(
930
928
cvx_hull.clear ();
931
929
932
930
if (cloud.size () <= 2 ) {
931
+ if (cloud.size () == 2 ) {
932
+ if (cloud[0 ](0 ) < cloud[1 ](0 )) {
933
+ std::swap (cloud[0 ], cloud[1 ]);
934
+ }
935
+ }
933
936
// Point or segment, nothing to do.
934
937
for (const Vec2f& point : cloud) {
935
938
cvx_hull.emplace_back (point);
0 commit comments