Skip to content

Commit eb0b025

Browse files
committed
Sphere-Cylinder: take swept-sphere radius into account
1 parent cfcb0bd commit eb0b025

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/narrowphase/details.h

+10
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ inline FCL_REAL sphereCylinderDistance(const Sphere& s1, const Transform3f& tf1,
195195
}
196196
}
197197
}
198+
199+
// Take swept-sphere radius into account
200+
const FCL_REAL ssr1 = s1.getSweptSphereRadius();
201+
const FCL_REAL ssr2 = s2.getSweptSphereRadius();
202+
if (ssr1 > 0 || ssr2 > 0) {
203+
p1 += ssr1 * normal;
204+
p2 -= ssr2 * normal;
205+
dist -= (ssr1 + ssr2);
206+
}
207+
198208
return dist;
199209
}
200210

0 commit comments

Comments
 (0)