5 #ifndef COAL_SERIALIZATION_COLLISION_DATA_H
6 #define COAL_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);
21 ar& make_nvp(
"pos", contact.
pos);
25 template <
class Archive>
27 ar >> make_nvp(
"b1", contact.
b1);
28 ar >> make_nvp(
"b2", contact.
b2);
29 ar >> make_nvp(
"normal", contact.
normal);
30 std::array<coal::Vec3s, 2> nearest_points;
31 ar >> make_nvp(
"nearest_points", nearest_points);
34 ar >> make_nvp(
"pos", contact.
pos);
42 template <
class Archive>
44 const unsigned int ) {
49 ar& make_nvp(
"enable_cached_gjk_guess",
53 ar& make_nvp(
"cached_support_func_guess",
57 ar& make_nvp(
"gjk_variant", query_request.
gjk_variant);
58 ar& make_nvp(
"gjk_convergence_criterion",
60 ar& make_nvp(
"gjk_convergence_criterion_type",
64 ar& make_nvp(
"collision_distance_threshold",
69 template <
class Archive>
71 const unsigned int ) {
73 ar& make_nvp(
"cached_support_func_guess",
77 template <
class Archive>
79 const unsigned int ) {
80 ar& make_nvp(
"base", boost::serialization::base_object<coal::QueryRequest>(
86 ar& make_nvp(
"enable_distance_lower_bound",
94 template <
class Archive>
96 const unsigned int ) {
97 ar& make_nvp(
"base", boost::serialization::base_object<coal::QueryResult>(
99 ar& make_nvp(
"contacts", collision_result.
getContacts());
102 ar& make_nvp(
"normal", collision_result.
normal);
105 template <
class Archive>
107 const unsigned int ) {
108 ar >> make_nvp(
"base", boost::serialization::base_object<coal::QueryResult>(
110 std::vector<coal::Contact> contacts;
111 ar >> make_nvp(
"contacts", contacts);
112 collision_result.
clear();
113 for (
size_t k = 0; k < contacts.size(); ++k)
116 std::array<coal::Vec3s, 2> nearest_points;
117 ar >> make_nvp(
"nearest_points", nearest_points);
120 ar >> make_nvp(
"normal", collision_result.
normal);
125 template <
class Archive>
127 const unsigned int ) {
128 ar& make_nvp(
"base", boost::serialization::base_object<coal::QueryRequest>(
134 ar& make_nvp(
"enable_signed_distance",
136 ar& make_nvp(
"rel_err", distance_request.
rel_err);
137 ar& make_nvp(
"abs_err", distance_request.
abs_err);
140 template <
class Archive>
142 const unsigned int ) {
143 ar& make_nvp(
"base", boost::serialization::base_object<coal::QueryResult>(
145 ar& make_nvp(
"min_distance", distance_result.
min_distance);
147 ar& make_nvp(
"normal", distance_result.
normal);
148 ar& make_nvp(
"b1", distance_result.
b1);
149 ar& make_nvp(
"b2", distance_result.
b2);
152 template <
class Archive>
154 const unsigned int ) {
155 ar >> make_nvp(
"base", boost::serialization::base_object<coal::QueryResult>(
157 ar >> make_nvp(
"min_distance", distance_result.
min_distance);
158 std::array<coal::Vec3s, 2> nearest_points;
159 ar >> make_nvp(
"nearest_points", nearest_points);
162 ar >> make_nvp(
"normal", distance_result.
normal);
163 ar >> make_nvp(
"b1", distance_result.
b1);
164 ar >> make_nvp(
"b2", distance_result.
b2);
165 distance_result.
o1 = NULL;
166 distance_result.
o2 = NULL;
#define COAL_SERIALIZATION_DECLARE_EXPORT(T)
Definition: fwd.h:30
#define COAL_SERIALIZATION_SPLIT(Type)
Definition: fwd.h:24
#define COAL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
Definition: fwd.hh:122
#define COAL_COMPILER_DIAGNOSTIC_PUSH
Definition: fwd.hh:120
#define COAL_COMPILER_DIAGNOSTIC_POP
Definition: fwd.hh:121
void load(Archive &ar, coal::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:44
void save(Archive &ar, const coal::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:30
void serialize(Archive &ar, coal::AABB &aabb, const unsigned int)
Definition: AABB.h:15
Main namespace.
Definition: broadphase_bruteforce.h:44
request to the collision algorithm
Definition: collision_data.h:311
bool enable_distance_lower_bound
Whether a lower bound on distance is returned when objects are disjoint.
Definition: collision_data.h:321
Scalar security_margin
Distance below which objects are considered in collision. See Collision.
Definition: collision_data.h:328
bool enable_contact
whether the contact information (normal, penetration depth and contact position) will return.
Definition: collision_data.h:317
Scalar distance_upper_bound
Distance above which GJK solver makes an early stopping. GJK stops searching for the closest points w...
Definition: collision_data.h:340
Scalar break_distance
Distance below which bounding volumes are broken down. See Collision.
Definition: collision_data.h:332
size_t num_max_contacts
The maximum number of contacts that can be returned.
Definition: collision_data.h:313
collision result
Definition: collision_data.h:390
Vec3s normal
normal associated to nearest_points. Same as CollisionResult::nearest_points but for the normal.
Definition: collision_data.h:405
Scalar distance_lower_bound
Definition: collision_data.h:401
void addContact(const Contact &c)
add one contact into result structure
Definition: collision_data.h:430
std::array< Vec3s, 2 > nearest_points
nearest points. A CollisionResult can have multiple contacts. The nearest points in CollisionResults ...
Definition: collision_data.h:414
void getContacts(std::vector< Contact > &contacts_) const
get all the contacts
Definition: collision_data.h:474
void clear()
clear the results obtained
Definition: collision_data.h:482
request to the distance computation
Definition: collision_data.h:984
Scalar rel_err
error threshold for approximate distance
Definition: collision_data.h:1012
bool enable_signed_distance
whether to compute the penetration depth when objects are in collision. Turning this off can save com...
Definition: collision_data.h:1009
Scalar abs_err
Definition: collision_data.h:1013
bool enable_nearest_points
whether to return the nearest points. Nearest points are always computed and are the points of the sh...
Definition: collision_data.h:995
distance result
Definition: collision_data.h:1050
int b1
information about the nearest point in object 1 if object 1 is mesh or point cloud,...
Definition: collision_data.h:1076
const CollisionGeometry * o2
collision object 2
Definition: collision_data.h:1070
const CollisionGeometry * o1
collision object 1
Definition: collision_data.h:1067
int b2
information about the nearest point in object 2 if object 2 is mesh or point cloud,...
Definition: collision_data.h:1082
std::array< Vec3s, 2 > nearest_points
nearest points. See CollisionResult::nearest_points.
Definition: collision_data.h:1064
Scalar min_distance
minimum distance between two objects. If two objects are in collision and DistanceRequest::enable_sig...
Definition: collision_data.h:1057
Vec3s normal
normal.
Definition: collision_data.h:1060
base class for all query requests
Definition: collision_data.h:170
Scalar epa_tolerance
tolerance for EPA. Note: This tolerance determines the precision on the estimated distance between tw...
Definition: collision_data.h:211
Vec3s cached_gjk_guess
the gjk initial guess set by user
Definition: collision_data.h:180
size_t epa_max_iterations
max number of iterations for EPA
Definition: collision_data.h:204
Scalar collision_distance_threshold
threshold below which a collision is considered.
Definition: collision_data.h:217
GJKConvergenceCriterion gjk_convergence_criterion
convergence criterion used to stop GJK
Definition: collision_data.h:198
bool enable_timings
enable timings when performing collision/distance request
Definition: collision_data.h:214
support_func_guess_t cached_support_func_guess
the support function initial guess set by user
Definition: collision_data.h:183
bool enable_cached_gjk_guess
whether enable gjk initial guess @Deprecated Use gjk_initial_guess instead
Definition: collision_data.h:177
Scalar gjk_tolerance
tolerance for the GJK algorithm. Note: This tolerance determines the precision on the estimated dista...
Definition: collision_data.h:192
GJKVariant gjk_variant
whether to enable the Nesterov accleration of GJK
Definition: collision_data.h:195
GJKConvergenceCriterionType gjk_convergence_criterion_type
convergence criterion used to stop GJK
Definition: collision_data.h:201
GJKInitialGuess gjk_initial_guess
Definition: collision_data.h:172
size_t gjk_max_iterations
maximum iteration for the GJK algorithm
Definition: collision_data.h:186
base class for all query results
Definition: collision_data.h:275
Vec3s cached_gjk_guess
stores the last GJK ray when relevant.
Definition: collision_data.h:277
support_func_guess_t cached_support_func_guess
stores the last support function vertex index, when relevant.
Definition: collision_data.h:280