From ee5b686d708aa2e389446588ff32fc5d7a227705 Mon Sep 17 00:00:00 2001 From: Mattia Montanari Date: Thu, 24 Nov 2022 00:08:45 +0100 Subject: [PATCH 1/2] Postpone computatoin of some hff tests --- openGJK.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openGJK.c b/openGJK.c index d80cd99..d8777ec 100644 --- a/openGJK.c +++ b/openGJK.c @@ -226,12 +226,12 @@ inline static void S2D(gkSimplex *s, gkFloat *v) { gkFloat *s3p = s->vrtx[0]; int hff1f_s12 = hff1(s1p, s2p); int hff1f_s13 = hff1(s1p, s3p); - int hff2f_23 = !hff2(s1p, s2p, s3p); - int hff2f_32 = !hff2(s1p, s3p, s2p); if (hff1f_s12) { + int hff2f_23 = !hff2(s1p, s2p, s3p); if (hff2f_23) { if (hff1f_s13) { + int hff2f_32 = !hff2(s1p, s3p, s2p); if (hff2f_32) { projectOnPlane(s1p, s2p, s3p, v); // Update s, no need to update c return; // Return V{1,2,3} @@ -250,6 +250,7 @@ inline static void S2D(gkSimplex *s, gkFloat *v) { return; // Return V{1,2} } } else if (hff1f_s13) { + int hff2f_32 = !hff2(s1p, s3p, s2p); if (hff2f_32) { projectOnPlane(s1p, s2p, s3p, v); // Update s, no need to update v return; // Return V{1,2,3} From 9c8a1150a8186d5bcf14029b7b818c7d0a8ee8dc Mon Sep 17 00:00:00 2001 From: Mattia Montanari Date: Thu, 24 Nov 2022 00:09:10 +0100 Subject: [PATCH 2/2] Remove old pieces of simplex struct --- include/openGJK/openGJK.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/openGJK/openGJK.h b/include/openGJK/openGJK.h index e917770..130d459 100644 --- a/include/openGJK/openGJK.h +++ b/include/openGJK/openGJK.h @@ -40,8 +40,6 @@ typedef struct gkPolytope_ { /// @brief Structure of the simplex typedef struct gkSimplex_ { int nvrtx; // Number of simplex's vertices - int wids[4]; // Label of the simplex's vertices - gkFloat lambdas[4]; // Barycentric coordiantes for each vertex gkFloat vrtx[4][3]; // Coordinates of simplex's vertices } gkSimplex;