Skip to content

Commit

Permalink
Fix ODR violation by btSoftSingleRayCallback
Browse files Browse the repository at this point in the history
Both btSoftMultiBodyDynamicsWorld.cpp and btSoftRigidDynamicsWorld.cpp
define a type btSoftSingleRayCallback. Though the types are very similar
they are not identical, causing an ODR violation.

Move the type definitions into anonymous namespaces so their names no
longer collide.
  • Loading branch information
miller-alex committed Mar 21, 2024
1 parent e88b71b commit b45d35d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ void btSoftMultiBodyDynamicsWorld::debugDrawWorld()
}
}

namespace {
struct btSoftSingleRayCallback : public btBroadphaseRayCallback
{
btVector3 m_rayFromWorld;
Expand Down Expand Up @@ -250,6 +251,7 @@ struct btSoftSingleRayCallback : public btBroadphaseRayCallback
return true;
}
};
}

void btSoftMultiBodyDynamicsWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const
{
Expand Down
2 changes: 2 additions & 0 deletions src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ void btSoftRigidDynamicsWorld::debugDrawWorld()
}
}

namespace {
struct btSoftSingleRayCallback : public btBroadphaseRayCallback
{
btVector3 m_rayFromWorld;
Expand Down Expand Up @@ -245,6 +246,7 @@ struct btSoftSingleRayCallback : public btBroadphaseRayCallback
return true;
}
};
}

void btSoftRigidDynamicsWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const
{
Expand Down

0 comments on commit b45d35d

Please sign in to comment.