Go to the documentation of this file.
11 #include <Eigen/StdVector>
12 #include <Eigen/Geometry>
13 #include <unsupported/Eigen/BVH>
38 inline double SQR(
double x) {
return x *
x; }
55 if((
b.center -
p).squaredNorm() <
SQR(
b.radius))
65 if((
b1.center -
b2.center).norm() <
b1.radius +
b2.radius)
72 if((
b.center -
v).squaredNorm() <
SQR(
b.radius))
96 typedef std::vector<VectorType, aligned_allocator<VectorType> >
VectorTypeList;
98 typedef std::vector<BallType, aligned_allocator<BallType> >
BallTypeList;
104 for(
int i = 0;
i < 500; ++
i) {
105 b.push_back(
BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
112 for(
int i = 0;
i < (
int)
b.size(); ++
i)
113 i1.intersectObject(
b[
i]);
123 for(
int i = 0;
i < 500; ++
i) {
124 b.push_back(
BallType(VectorType::Random(), 0.01 * internal::random(0., 1.)));
133 for(
int i = 0;
i < (
int)
b.size(); ++
i)
146 for(
int i = 0;
i < 50; ++
i) {
147 b.push_back(
BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
148 for(
int j = 0;
j < 3; ++
j)
149 v.push_back(VectorType::Random());
157 for(
int i = 0;
i < (
int)
b.size(); ++
i)
158 for(
int j = 0;
j < (
int)
v.size(); ++
j)
159 i1.intersectObjectObject(
b[
i],
v[
j]);
171 for(
int i = 0;
i < 50; ++
i) {
172 b.push_back(
BallType(VectorType::Random(), 1
e-7 + 1
e-6 * internal::random(0., 1.)));
173 for(
int j = 0;
j < 3; ++
j)
174 v.push_back(VectorType::Random());
184 for(
int i = 0;
i < (
int)
b.size(); ++
i)
185 for(
int j = 0;
j < (
int)
v.size(); ++
j)
198 #ifdef EIGEN_TEST_PART_1
206 #ifdef EIGEN_TEST_PART_2
214 #ifdef EIGEN_TEST_PART_3
bool intersectObjectObject(const BallType &b1, const BallType &b2)
Matrix< double, Dim, 1 > VectorType
Namespace containing all symbols from the Eigen library.
Matrix< double, Dim, 1 > VectorType
double minimumOnObjectObject(const BallType &b, const VectorType &v)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool intersectVolume(const BoxType &r)
bool intersectVolumeObject(const BoxType &r, const VectorType &v)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Box2d bounding_box(const Vector2d &v)
double minimumOnObjectObject(const BallType &b1, const BallType &b2)
A simple bounding volume hierarchy based on AlignedBox.
double minimumOnVolume(const BoxType &r)
bool intersectVolumeVolume(const BoxType &r1, const BoxType &r2)
static const Point3 pt(1.0, 2.0, 3.0)
AlignedBox< double, Dim > BoxType
AlignedBox< double, Dim > BoxType
double minimumOnVolumeObject(const BoxType &r, const VectorType &v)
bool intersectObjectVolume(const BallType &b, const BoxType &r)
Ball(const VectorType &c, double r)
BallPointStuff(const VectorType &inP)
void test4(OptionalJacobian< 2, 3 > H={})
double minimumOnVolumeObject(const BoxType &r, const BallType &b)
std::vector< BallType, aligned_allocator< BallType > > BallTypeList
EIGEN_DEVICE_FUNC bool contains(const MatrixBase< Derived > &p) const
bool intersectObjectObject(const BallType &b, const VectorType &v)
std::vector< VectorType, aligned_allocator< VectorType > > VectorTypeList
void BVIntersect(const BVH &tree, Intersector &intersector)
#define VERIFY_IS_APPROX(a, b)
void test3(double add, OptionalJacobian< 2, 1 > H={})
bool intersectVolumeObject(const BoxType &r, const BallType &b)
double minimumOnVolumeVolume(const BoxType &r1, const BoxType &r2)
double minimumOnObject(const BallType &b)
Array< int, Dynamic, 1 > v
EIGEN_DEVICE_FUNC Scalar squaredExteriorDistance(const MatrixBase< Derived > &p) const
void test2(OptionalJacobian<-1,-1 > H={})
bool intersectObject(const BallType &b)
Minimizer::Scalar BVMinimize(const BVH &tree, Minimizer &minimizer)
AlignedBox< double, Dim > bounding_box(const Ball< Dim > &b)
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar, Size)
EIGEN_DEVICE_FUNC NonInteger exteriorDistance(const MatrixBase< Derived > &p) const
#define CALL_SUBTEST(FUNC)
double minimumOnObjectVolume(const BallType &b, const BoxType &r)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:56