@@ -475,13 +475,20 @@ void WbSimulationCluster::handleCollisionIfSpace(void *data, dGeomID o1, dGeomID
475475 }
476476}
477477
478- void WbSimulationCluster::warnMoreContactPointsThanContactJoints () {
478+ void WbSimulationCluster::warnMoreContactPointsThanContactJoints (const QString &material1, const QString &material2, int max,
479+ int n) {
479480 static QMutex mutex;
480481 QMutexLocker<QMutex> lock (&mutex);
481482 static double lastWarningTime = -INFINITY;
482483 const double currentSimulationTime = WbSimulationState::instance ()->time ();
483484 if (currentSimulationTime > lastWarningTime + 1000.0 ) {
484- WbLog::warning (QObject::tr (" Contact joints will only be created for the deepest contact points." ), false , WbLog::ODE);
485+ WbLog::warning (QObject::tr (" Contact joints between materials '%1' and '%2' will only be created for the %3 deepest contact "
486+ " points instead of all the %4 contact points." )
487+ .arg (material1)
488+ .arg (material2)
489+ .arg (max)
490+ .arg (n),
491+ false , WbLog::ODE);
485492 lastWarningTime = currentSimulationTime;
486493 }
487494}
@@ -656,7 +663,6 @@ void WbSimulationCluster::odeNearCallback(void *data, dGeomID o1, dGeomID o2) {
656663 n = n->parentNode ();
657664 }
658665 }
659-
660666 const WbContactProperties *contactProperties = cl->findContactProperties (s1, s2);
661667 const int maxContactJoints = contactProperties ? contactProperties->maxContactJoints () : 10 ;
662668
@@ -679,7 +685,8 @@ void WbSimulationCluster::odeNearCallback(void *data, dGeomID o1, dGeomID o2) {
679685 return ;
680686
681687 if (n > maxContactJoints) {
682- WbSimulationCluster::warnMoreContactPointsThanContactJoints ();
688+ WbSimulationCluster::warnMoreContactPointsThanContactJoints (s1->contactMaterial (), s2->contactMaterial (), maxContactJoints,
689+ n);
683690 std::nth_element (contact, contact + maxContactJoints, contact + n,
684691 [](const dContact &c1, const dContact &c2) { return (c1.geom .depth > c2.geom .depth ); });
685692 n = maxContactJoints;
0 commit comments