5 #ifndef HPP_FCL_SERIALIZATION_COLLISION_DATA_H 6 #define HPP_FCL_SERIALIZATION_COLLISION_DATA_H 12 namespace serialization {
14 template <
class Archive>
16 const unsigned int ) {
17 ar& make_nvp(
"b1", contact.
b1);
18 ar& make_nvp(
"b2", contact.
b2);
19 ar& make_nvp(
"normal", contact.
normal);
20 ar& make_nvp(
"pos", contact.
pos);
24 template <
class Archive>
26 const unsigned int ) {
27 ar >> make_nvp(
"b1", contact.
b1);
28 ar >> make_nvp(
"b2", contact.
b2);
29 ar >> make_nvp(
"normal", contact.
normal);
30 ar >> make_nvp(
"pos", contact.
pos);
38 template <
class Archive>
40 const unsigned int ) {
45 ar& make_nvp(
"enable_cached_gjk_guess",
49 ar& make_nvp(
"cached_support_func_guess",
54 template <
class Archive>
56 const unsigned int ) {
58 ar& make_nvp(
"cached_support_func_guess",
62 template <
class Archive>
64 const unsigned int ) {
66 boost::serialization::base_object<hpp::fcl::QueryRequest>(
70 ar& make_nvp(
"enable_distance_lower_bound",
76 template <
class Archive>
78 const unsigned int ) {
79 ar& make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
81 ar& make_nvp(
"contacts", collision_result.
getContacts());
85 template <
class Archive>
87 const unsigned int ) {
89 make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
91 std::vector<hpp::fcl::Contact> contacts;
92 ar >> make_nvp(
"contacts", contacts);
93 collision_result.
clear();
94 for (
size_t k = 0; k < contacts.size(); ++k)
101 template <
class Archive>
103 const unsigned int ) {
105 boost::serialization::base_object<hpp::fcl::QueryRequest>(
108 ar& make_nvp(
"rel_err", distance_request.
rel_err);
109 ar& make_nvp(
"abs_err", distance_request.
abs_err);
112 template <
class Archive>
114 const unsigned int ) {
115 ar& make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
117 ar& make_nvp(
"min_distance", distance_result.
min_distance);
118 ar& make_nvp(
"nearest_points", make_array(distance_result.
nearest_points, 2));
119 ar& make_nvp(
"normal", distance_result.
normal);
120 ar& make_nvp(
"b1", distance_result.
b1);
121 ar& make_nvp(
"b2", distance_result.
b2);
124 template <
class Archive>
126 const unsigned int ) {
128 make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
130 ar >> make_nvp(
"min_distance", distance_result.
min_distance);
132 make_nvp(
"nearest_points", make_array(distance_result.
nearest_points, 2));
133 ar >> make_nvp(
"normal", distance_result.
normal);
134 ar >> make_nvp(
"b1", distance_result.
b1);
135 ar >> make_nvp(
"b2", distance_result.
b2);
136 distance_result.
o1 = NULL;
137 distance_result.
o2 = NULL;
145 #endif // ifndef HPP_FCL_SERIALIZATION_COLLISION_DATA_H support_func_guess_t cached_support_func_guess
the support function initial guess set by user
size_t num_max_contacts
The maximum number of contacts will return.
GJKInitialGuess gjk_initial_guess
request to the distance computation
support_func_guess_t cached_support_func_guess
stores the last support function vertex index, when relevant.
const CollisionGeometry * o1
collision object 1
base class for all query results
#define HPP_FCL_SERIALIZATION_SPLIT(Type)
int b2
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
Vec3f nearest_points[2]
nearest points
bool enable_cached_gjk_guess
whether enable gjk initial guess Use gjk_initial_guess instead
void addContact(const Contact &c)
add one contact into result structure
FCL_REAL distance_lower_bound
void serialize(Archive &ar, hpp::fcl::AABB &aabb, const unsigned int)
#define HPP_FCL_COMPILER_DIAGNOSTIC_POP
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
request to the collision algorithm
void clear()
clear the results obtained
FCL_REAL min_distance
minimum distance between two objects. if two objects are in collision, min_distance <= 0...
int b1
information about the nearest point in object 1 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
Vec3f normal
In case both objects are in collision, store the normal.
void save(Archive &ar, const hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
void getContacts(std::vector< Contact > &contacts_) const
get all the contacts
Vec3f cached_gjk_guess
the gjk initial guess set by user
bool enable_timings
enable timings when performing collision/distance request
FCL_REAL break_distance
Distance below which bounding volumes are broken down. See Collision.
FCL_REAL rel_err
error threshold for approximate distance
bool enable_nearest_points
whether to return the nearest points
bool enable_distance_lower_bound
Whether a lower bound on distance is returned when objects are disjoint.
bool enable_contact
whether the contact information (normal, penetration depth and contact position) will return ...
Vec3f cached_gjk_guess
stores the last GJK ray when relevant.
base class for all query requests
#define HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
void load(Archive &ar, hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
const CollisionGeometry * o2
collision object 2
FCL_REAL security_margin
Distance below which objects are considered in collision. See Collision.