-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathminkowski_diff.h
55 lines (40 loc) · 1.41 KB
/
minkowski_diff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "gjk_shape.h"
namespace fcl {
namespace cvx_collide {
/// @brief The vertex/direction to obtain that vertex on Mink
template <typename T>
struct MinkowskiDiffVertex {
Vector3<T> vertex;
Vector3<T> direction;
};
/// @brief Minkowski difference class of two shapes
template <typename T>
struct MinkowskiDiff {
/// @brief points to two shapes
GJKGeometryData<T> shapes[2];
/// Function for support and interior
/// Default value are provided, can be over-written if necessary
SupportFunction<T> support_function;
InteriorFunction<T> interior_function;
/// @brief rotation from shape0 to shape1
Matrix3<T> toshape1;
/// @brief transform from shape1 to shape0
Transform3<T> toshape0;
MinkowskiDiff();
/// @brief support function for shape0
Vector3<T> support0(const Vector3<T>& d) const;
/// @brief support function for shape1
Vector3<T> support1(const Vector3<T>& d) const;
/// @brief support function for the pair of shapes
Vector3<T> support(const Vector3<T>& d) const;
MinkowskiDiffVertex<T> supportVertex(const Vector3<T>& d) const;
/// @brief support function for the d-th shape (d = 0 or 1)
Vector3<T> support(const Vector3<T>& d, size_t index) const;
/// @brief Compute an interior point inside the MinkowskiDiff
Vector3<T> interior() const;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
} // namespace cvx_collide
} // namespace fcl
#include "minkowski_diff.hpp"