Postpone computatoin of some hff tests

fixes-turtlebasket
Mattia Montanari 2022-11-24 00:08:45 +01:00
parent 7a018a3c60
commit ee5b686d70
1 changed files with 3 additions and 2 deletions

View File

@ -226,12 +226,12 @@ inline static void S2D(gkSimplex *s, gkFloat *v) {
gkFloat *s3p = s->vrtx[0]; gkFloat *s3p = s->vrtx[0];
int hff1f_s12 = hff1(s1p, s2p); int hff1f_s12 = hff1(s1p, s2p);
int hff1f_s13 = hff1(s1p, s3p); int hff1f_s13 = hff1(s1p, s3p);
int hff2f_23 = !hff2(s1p, s2p, s3p);
int hff2f_32 = !hff2(s1p, s3p, s2p);
if (hff1f_s12) { if (hff1f_s12) {
int hff2f_23 = !hff2(s1p, s2p, s3p);
if (hff2f_23) { if (hff2f_23) {
if (hff1f_s13) { if (hff1f_s13) {
int hff2f_32 = !hff2(s1p, s3p, s2p);
if (hff2f_32) { if (hff2f_32) {
projectOnPlane(s1p, s2p, s3p, v); // Update s, no need to update c projectOnPlane(s1p, s2p, s3p, v); // Update s, no need to update c
return; // Return V{1,2,3} return; // Return V{1,2,3}
@ -250,6 +250,7 @@ inline static void S2D(gkSimplex *s, gkFloat *v) {
return; // Return V{1,2} return; // Return V{1,2}
} }
} else if (hff1f_s13) { } else if (hff1f_s13) {
int hff2f_32 = !hff2(s1p, s3p, s2p);
if (hff2f_32) { if (hff2f_32) {
projectOnPlane(s1p, s2p, s3p, v); // Update s, no need to update v projectOnPlane(s1p, s2p, s3p, v); // Update s, no need to update v
return; // Return V{1,2,3} return; // Return V{1,2,3}