Skip to content

Commit

Permalink
core: check in initialize_gjk in GJKSolver
Browse files Browse the repository at this point in the history
  • Loading branch information
lmontaut committed Jun 3, 2022
1 parent 492f0ff commit 1d92924
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/hpp/fcl/narrowphase/narrowphase.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ struct HPP_FCL_DLLAPI GJKSolver {
support_hint = support_func_cached_guess;
break;
case GJKInitialGuess::BoundingVolumeGuess:
if (s1.aabb_radius < 0 || s2.aabb_radius < 0) {
throw std::logic_error(
"computeLocalAABB must have been called on the shapes when using "
"GJKInitialGuess::BoundingVolumeGuess.");
}
guess.noalias() =
s1.aabb_center - (shape.oR1 * s2.aabb_center + shape.ot1);
support_hint =
Expand Down

0 comments on commit 1d92924

Please sign in to comment.