coal
3.0.4
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Toggle main menu visibility
Loading...
Searching...
No Matches
kIOS.h
Go to the documentation of this file.
1
//
2
// Copyright (c) 2024 INRIA
3
//
4
5
#ifndef COAL_SERIALIZATION_kIOS_H
6
#define COAL_SERIALIZATION_kIOS_H
7
8
#include "
coal/BV/kIOS.h
"
9
10
#include "
coal/serialization/OBB.h
"
11
#include "
coal/serialization/fwd.h
"
12
13
namespace
boost
{
14
namespace
serialization
{
15
16
template
<
class
Archive>
17
void
serialize
(Archive& ar,
coal::kIOS
& bv,
const
unsigned
int
version) {
18
split_free(ar, bv, version);
19
}
20
21
template
<
class
Archive>
22
void
save
(Archive& ar,
const
coal::kIOS
& bv,
const
unsigned
int
/*version*/
) {
23
// Number of spheres in kIOS is never larger than kIOS::kios_max_num_spheres
24
ar& make_nvp(
"num_spheres"
, bv.
num_spheres
);
25
26
std::array<coal::Vec3s, coal::kIOS::max_num_spheres> centers{};
27
std::array<coal::CoalScalar, coal::kIOS::max_num_spheres> radii;
28
for
(std::size_t i = 0; i <
coal::kIOS::max_num_spheres
; ++i) {
29
centers[i] = bv.
spheres
[i].
o
;
30
radii[i] = bv.
spheres
[i].
r
;
31
}
32
ar& make_nvp(
"centers"
, make_array(centers.data(), centers.size()));
33
ar& make_nvp(
"radii"
, make_array(radii.data(), radii.size()));
34
35
ar& make_nvp(
"obb"
, bv.
obb
);
36
}
37
38
template
<
class
Archive>
39
void
load
(Archive& ar,
coal::kIOS
& bv,
const
unsigned
int
/*version*/
) {
40
ar >> make_nvp(
"num_spheres"
, bv.
num_spheres
);
41
42
std::array<coal::Vec3s, coal::kIOS::max_num_spheres> centers;
43
std::array<coal::CoalScalar, coal::kIOS::max_num_spheres> radii;
44
ar >> make_nvp(
"centers"
, make_array(centers.data(), centers.size()));
45
ar >> make_nvp(
"radii"
, make_array(radii.data(), radii.size()));
46
for
(std::size_t i = 0; i <
coal::kIOS::max_num_spheres
; ++i) {
47
bv.
spheres
[i].
o
= centers[i];
48
bv.
spheres
[i].
r
= radii[i];
49
}
50
51
ar >> make_nvp(
"obb"
, bv.
obb
);
52
}
53
54
}
// namespace serialization
55
}
// namespace boost
56
57
#endif
// COAL_SERIALIZATION_kIOS_H
kIOS.h
coal::kIOS
A class describing the kIOS collision structure, which is a set of spheres.
Definition
kIOS.h:52
fwd.h
coal::kIOS::obb
OBB obb
@ OBB related with kIOS
Definition
kIOS.h:122
coal::kIOS::num_spheres
unsigned int num_spheres
The number of spheres, no larger than 5.
Definition
kIOS.h:119
coal::kIOS::max_num_spheres
static constexpr size_t max_num_spheres
Definition
kIOS.h:113
coal::kIOS::spheres
kIOS_Sphere spheres[max_num_spheres]
The (at most) five spheres for intersection.
Definition
kIOS.h:116
coal::kIOS::kIOS_Sphere::o
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Vec3s o
Definition
kIOS.h:57
coal::kIOS::kIOS_Sphere::r
CoalScalar r
Definition
kIOS.h:58
OBB.h
boost::serialization
Definition
AABB.h:12
boost::serialization::load
void load(Archive &ar, coal::BVSplitter< BV > &splitter_, const unsigned int)
Definition
BV_splitter.h:44
boost::serialization::save
void save(Archive &ar, const coal::BVSplitter< BV > &splitter_, const unsigned int)
Definition
BV_splitter.h:30
boost::serialization::serialize
void serialize(Archive &ar, coal::AABB &aabb, const unsigned int)
Definition
AABB.h:15
boost
Definition
AABB.h:11
include
coal
serialization
kIOS.h
Generated by
1.17.0