Skip to content
Snippets Groups Projects
Commit 62990025 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

[C++] Remove GeometryData::isColliding(Index&)

parent c31f4728
No related branches found
No related tags found
No related merge requests found
......@@ -241,6 +241,15 @@ namespace se3
/// attached to the body from the joint center.
///
std::vector<double> radius;
///
/// \brief index of the collision pair
///
/// It is used by some method to return additional information. For instance,
/// isColliding() sets it to the first colliding pair.
///
Index collisionPairIndex;
GeometryData(const GeometryModel & modelGeom)
: model_geom(modelGeom)
, oMg(model_geom.ngeoms)
......@@ -289,12 +298,8 @@ namespace se3
/// \brief Check if at least one of the collision pairs has its two collision objects in collision.
/// The results are stored in the vector GeometryData::collision_results.
///
/// \param[out] the index of the colliding pair if the function returns true.
/// Set collisionPairIndex to the index of the first colliding pair in collision.
///
bool isColliding(Index& collidingPair);
/// \brief See bool isColliding(Index&)
/// As isColliding(Index&) without argument
bool isColliding();
///
......
......@@ -232,8 +232,9 @@ namespace se3
}
}
inline bool GeometryData::isColliding(Index& i)
inline bool GeometryData::isColliding()
{
Index& i = collisionPairIndex;
for(i = 0; i<model_geom.collisionPairs.size(); ++i)
{
if (activeCollisionPairs[i] && computeCollision(i))
......@@ -242,12 +243,6 @@ namespace se3
return false;
}
inline bool GeometryData::isColliding()
{
Index pair;
return isColliding(pair);
}
inline DistanceResult GeometryData::computeDistance(const CollisionPair & pair) const
{
const Index & co1 = pair.first; assert(co1<collisionObjects.size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment