diff --git a/dartsim/src/GzOdeCollisionDetector.cc b/dartsim/src/GzOdeCollisionDetector.cc index e54aee2a2..d8c2b446d 100644 --- a/dartsim/src/GzOdeCollisionDetector.cc +++ b/dartsim/src/GzOdeCollisionDetector.cc @@ -92,6 +92,10 @@ void GzOdeCollisionDetector::LimitMaxContacts( auto allContacts = _result->getContacts(); _result->clear(); + + if (this->maxCollisionPairContacts == 0u) + return; + // A map of collision pairs and their their contact info // Contact info is stored in std::pair. The elements are: //