Skip to content

Commit

Permalink
[Broadphase] add clear method to collision data
Browse files Browse the repository at this point in the history
  • Loading branch information
lmontaut committed Jan 4, 2024
1 parent c2c84e3 commit 7be1fa1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions include/hpp/fcl/broadphase/default_broadphase_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ struct CollisionData {

/// @brief Whether the collision iteration can stop
bool done;

/// @brief Clears the CollisionData
void clear() {
result.clear();
done = false;
}
};

/// @brief Distance data stores the distance request and the result given by
Expand All @@ -79,6 +85,12 @@ struct DistanceData {

/// @brief Whether the distance iteration can stop
bool done;

/// @brief Clears the DistanceData
void clear() {
result.clear();
done = false;
}
};

/// @brief Provides a simple callback for the collision query in the
Expand Down
6 changes: 4 additions & 2 deletions python/broadphase/broadphase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ void exposeBroadPhase() {
.def(dv::init<CollisionData>())
.DEF_RW_CLASS_ATTRIB(CollisionData, request)
.DEF_RW_CLASS_ATTRIB(CollisionData, result)
.DEF_RW_CLASS_ATTRIB(CollisionData, done);
.DEF_RW_CLASS_ATTRIB(CollisionData, done)
.DEF_CLASS_FUNC(CollisionData, clear);

bp::class_<DistanceData>("DistanceData", bp::no_init)
.def(dv::init<DistanceData>())
.DEF_RW_CLASS_ATTRIB(DistanceData, request)
.DEF_RW_CLASS_ATTRIB(DistanceData, result)
.DEF_RW_CLASS_ATTRIB(DistanceData, done);
.DEF_RW_CLASS_ATTRIB(DistanceData, done)
.DEF_CLASS_FUNC(DistanceData, clear);

BroadPhaseCollisionManagerWrapper::expose();

Expand Down

0 comments on commit 7be1fa1

Please sign in to comment.