coal 3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Loading...
Searching...
No Matches
collision_object.h
Go to the documentation of this file.
1//
2// Copyright (c) 2021 INRIA
3//
4
5#ifndef COAL_SERIALIZATION_COLLISION_OBJECT_H
6#define COAL_SERIALIZATION_COLLISION_OBJECT_H
7
9
12
13namespace boost {
14namespace serialization {
15
16template <class Archive>
17void save(Archive& ar, const coal::CollisionGeometry& collision_geometry,
18 const unsigned int /*version*/) {
19 ar& make_nvp("aabb_center", collision_geometry.aabb_center);
20 ar& make_nvp("aabb_radius", collision_geometry.aabb_radius);
21 ar& make_nvp("aabb_local", collision_geometry.aabb_local);
22 ar& make_nvp("cost_density", collision_geometry.cost_density);
23 ar& make_nvp("threshold_occupied", collision_geometry.threshold_occupied);
24 ar& make_nvp("threshold_free", collision_geometry.threshold_free);
25}
26
27template <class Archive>
28void load(Archive& ar, coal::CollisionGeometry& collision_geometry,
29 const unsigned int /*version*/) {
30 ar >> make_nvp("aabb_center", collision_geometry.aabb_center);
31 ar >> make_nvp("aabb_radius", collision_geometry.aabb_radius);
32 ar >> make_nvp("aabb_local", collision_geometry.aabb_local);
33 ar >> make_nvp("cost_density", collision_geometry.cost_density);
34 ar >> make_nvp("threshold_occupied", collision_geometry.threshold_occupied);
35 ar >> make_nvp("threshold_free", collision_geometry.threshold_free);
36 collision_geometry.user_data = NULL; // no way to recover this
37}
38
40
41} // namespace serialization
42} // namespace boost
43
44namespace coal {
45
46// fwd declaration
47template <typename BV>
48class HeightField;
49
50template <typename PolygonT>
51class ConvexTpl;
52
53struct OBB;
54struct OBBRSS;
55class AABB;
56
57class OcTree;
58class Box;
59class Sphere;
60class Ellipsoid;
61class Capsule;
62class Cone;
63class TriangleP;
64class Cylinder;
65class Halfspace;
66class Plane;
67
68namespace serialization {
69template <>
71 template <class Archive>
72 static void on(Archive& ar) {
73 ar.template register_type<Box>();
74 ar.template register_type<Sphere>();
75 ar.template register_type<Ellipsoid>();
76 ar.template register_type<TriangleP>();
77 ar.template register_type<Capsule>();
78 ar.template register_type<Cone>();
79 ar.template register_type<Cylinder>();
80 ar.template register_type<Halfspace>();
81 ar.template register_type<Plane>();
82 ar.template register_type<OcTree>();
83 ar.template register_type<HeightField<OBB>>();
87 ;
88 }
89};
90} // namespace serialization
91} // namespace coal
92
93#endif // ifndef COAL_SERIALIZATION_COLLISION_OBJECT_H
The geometry for the object for collision or distance computation.
Definition collision_object.h:96
#define COAL_SERIALIZATION_SPLIT(Type)
Definition fwd.h:24
void * user_data
pointer to user defined data specific to this object
Definition collision_object.h:163
AABB aabb_local
AABB in local coordinate, used for tight AABB when only translation transform.
Definition collision_object.h:160
Scalar cost_density
collision cost for unit volume
Definition collision_object.h:166
Scalar threshold_occupied
threshold for occupied ( >= is occupied)
Definition collision_object.h:169
Scalar threshold_free
threshold for free (<= is free)
Definition collision_object.h:172
Vec3s aabb_center
AABB center in local coordinate.
Definition collision_object.h:153
Scalar aabb_radius
AABB radius.
Definition collision_object.h:156
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
Definition AABB.h:11
Main namespace.
Definition broadphase_bruteforce.h:44
static void on(Archive &ar)
Definition collision_object.h:72