Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print warning once from BulletCollisionDetector::collide/distance #1546

Merged
merged 1 commit into from
Apr 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions dart/collision/bullet/BulletCollisionDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,18 @@ bool BulletCollisionDetector::collide(
if (!checkGroupValidity(this, group2))
return false;

dtwarn << "[BulletCollisionDetector::collide] collide(group1, group2) "
<< "supposed to check collisions of the objects in group1 against the "
<< "objects in group2. However, the current implementation of this "
<< "function checks for all the objects against each other of both "
<< "group1 and group2, which is an incorrect behavior. This bug will "
<< "be fixed in the next patch release. (see #717 for the details)\n";
static bool warned = false;
if (!warned)
{
dtwarn
<< "[BulletCollisionDetector::collide] collide(group1, group2) "
<< "supposed to check collisions of the objects in group1 against the "
<< "objects in group2. However, the current implementation of this "
<< "function checks for all the objects against each other of both "
<< "group1 and group2, which is an incorrect behavior. This bug will "
<< "be fixed in the next patch release. (see #717 for the details)\n";
warned = true;
}

mGroupForFiltering.reset(new BulletCollisionGroup(shared_from_this()));
auto bulletCollisionWorld = mGroupForFiltering->getBulletCollisionWorld();
Expand Down Expand Up @@ -321,8 +327,14 @@ double BulletCollisionDetector::distance(
const DistanceOption& /*option*/,
DistanceResult* /*result*/)
{
dtwarn << "[BulletCollisionDetector::distance] This collision detector does "
<< "not support (signed) distance queries. Returning 0.0.\n";
static bool warned = false;
if (!warned)
{
dtwarn
<< "[BulletCollisionDetector::distance] This collision detector does "
<< "not support (signed) distance queries. Returning 0.0.\n";
warned = true;
}

return 0.0;
}
Expand All @@ -334,8 +346,14 @@ double BulletCollisionDetector::distance(
const DistanceOption& /*option*/,
DistanceResult* /*result*/)
{
dtwarn << "[BulletCollisionDetector::distance] This collision detector does "
<< "not support (signed) distance queries. Returning.\n";
static bool warned = false;
if (!warned)
{
dtwarn
<< "[BulletCollisionDetector::distance] This collision detector does "
<< "not support (signed) distance queries. Returning.\n";
warned = true;
}

return 0.0;
}
Expand Down