Skip to content

Commit

Permalink
change distance result brief information to intptr_t
Browse files Browse the repository at this point in the history
The distance result brief information stored the brief information
in an `int`. However, some primatives can only be stored by pointer
(namely octree nodes), and `int` is not wide enough on 64-bit
platforms to safely store a pointer. So upgrade the brief
information to be `intptr_t` which is guaranteed to be wide enough.
  • Loading branch information
C. Andy Martin committed May 20, 2020
1 parent 83a1af6 commit 3067b09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/fcl/common/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ using int64 = std::int64_t;
using uint64 = std::uint64_t;
using int32 = std::int32_t;
using uint32 = std::uint32_t;
using intptr_t = std::intptr_t;
using uintptr_t = std::uintptr_t;

template <typename S>
using Vector2 = Eigen::Matrix<S, 2, 1>;
Expand Down
4 changes: 2 additions & 2 deletions include/fcl/narrowphase/distance_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ struct FCL_EXPORT DistanceResult
/// if object 1 is mesh or point cloud, it is the triangle or point id
/// if object 1 is geometry shape, it is NONE (-1),
/// if object 1 is octree, it is the id of the cell
int b1;
intptr_t b1;

/// @brief information about the nearest point in object 2
/// if object 2 is mesh or point cloud, it is the triangle or point id
/// if object 2 is geometry shape, it is NONE (-1),
/// if object 2 is octree, it is the id of the cell
int b2;
intptr_t b2;

/// @brief invalid contact primitive information
static const int NONE = -1;
Expand Down

0 comments on commit 3067b09

Please sign in to comment.