Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-fcl
Commits
8fbd0cb6
Commit
8fbd0cb6
authored
Sep 02, 2019
by
Lucile Remigy
Browse files
Rename GJKSolver_indep in GJKSolver, delete include useless in types.h
parent
a387f349
Pipeline
#5433
failed with stage
in 41 minutes and 24 seconds
Changes
44
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/hpp/fcl/BV/AABB.h
View file @
8fbd0cb6
...
...
@@ -133,12 +133,6 @@ public:
return
true
;
}
/// @brief Volume of the AABB
inline
FCL_REAL
volume
()
const
{
return
width
()
*
height
()
*
depth
();
}
/// @brief Merge the AABB and a point
inline
AABB
&
operator
+=
(
const
Vec3f
&
p
)
{
...
...
@@ -180,6 +174,12 @@ public:
return
max_
[
2
]
-
min_
[
2
];
}
/// @brief Volume of the AABB
inline
FCL_REAL
volume
()
const
{
return
width
()
*
height
()
*
depth
();
}
/// @brief Size of the AABB (used in BV_Splitter to order two AABBs)
inline
FCL_REAL
size
()
const
{
...
...
include/hpp/fcl/collision_func_matrix.h
View file @
8fbd0cb6
...
...
@@ -49,7 +49,7 @@ namespace fcl
{
/// @brief collision matrix stores the functions for collision between different types of objects and provides a uniform call interface
template
<
typename
NarrowPhase
Solver
>
template
<
typename
GJK
Solver
>
struct
CollisionFunctionMatrix
{
/// @brief the uniform call interface for collision: for collision, we need know
...
...
@@ -57,7 +57,7 @@ struct CollisionFunctionMatrix
/// 2. the solver for narrow phase collision, this is for the collision between geometric shapes;
/// 3. the request setting for collision (e.g., whether need to return normal information, whether need to compute cost);
/// 4. the structure to return collision result
typedef
std
::
size_t
(
*
CollisionFunc
)(
const
CollisionGeometry
*
o1
,
const
Transform3f
&
tf1
,
const
CollisionGeometry
*
o2
,
const
Transform3f
&
tf2
,
const
NarrowPhase
Solver
*
nsolver
,
const
CollisionRequest
&
request
,
CollisionResult
&
result
);
typedef
std
::
size_t
(
*
CollisionFunc
)(
const
CollisionGeometry
*
o1
,
const
Transform3f
&
tf1
,
const
CollisionGeometry
*
o2
,
const
Transform3f
&
tf2
,
const
GJK
Solver
*
nsolver
,
const
CollisionRequest
&
request
,
CollisionResult
&
result
);
/// @brief each item in the collision matrix is a function to handle collision between objects of type1 and type2
CollisionFunc
collision_matrix
[
NODE_COUNT
][
NODE_COUNT
];
...
...
include/hpp/fcl/collision_object.h
View file @
8fbd0cb6
...
...
@@ -240,11 +240,7 @@ public:
return
t
.
getRotation
();
}
/// @brief get quaternion rotation of the object
inline
const
Quaternion3f
&
getQuatRotation
()
const
{
return
t
.
getQuatRotation
();
}
/// @brief get object's transform
inline
const
Transform3f
&
getTransform
()
const
...
...
@@ -264,11 +260,7 @@ public:
t
.
setTranslation
(
T
);
}
/// @brief set object's quatenrion rotation
void
setQuatRotation
(
const
Quaternion3f
&
q
)
{
t
.
setQuatRotation
(
q
);
}
/// @brief set object's transform
void
setTransform
(
const
Matrix3f
&
R
,
const
Vec3f
&
T
)
...
...
@@ -276,11 +268,7 @@ public:
t
.
setTransform
(
R
,
T
);
}
/// @brief set object's transform
void
setTransform
(
const
Quaternion3f
&
q
,
const
Vec3f
&
T
)
{
t
.
setTransform
(
q
,
T
);
}
/// @brief set object's transform
void
setTransform
(
const
Transform3f
&
tf
)
...
...
include/hpp/fcl/distance_func_matrix.h
View file @
8fbd0cb6
...
...
@@ -47,14 +47,14 @@ namespace fcl
{
/// @brief distance matrix stores the functions for distance between different types of objects and provides a uniform call interface
template
<
typename
NarrowPhase
Solver
>
template
<
typename
GJK
Solver
>
struct
DistanceFunctionMatrix
{
/// @brief the uniform call interface for distance: for distance, we need know
/// 1. two objects o1 and o2 and their configuration in world coordinate tf1 and tf2;
/// 2. the solver for narrow phase collision, this is for distance computation between geometric shapes;
/// 3. the request setting for distance (e.g., whether need to return nearest points);
typedef
FCL_REAL
(
*
DistanceFunc
)(
const
CollisionGeometry
*
o1
,
const
Transform3f
&
tf1
,
const
CollisionGeometry
*
o2
,
const
Transform3f
&
tf2
,
const
NarrowPhase
Solver
*
nsolver
,
typedef
FCL_REAL
(
*
DistanceFunc
)(
const
CollisionGeometry
*
o1
,
const
Transform3f
&
tf1
,
const
CollisionGeometry
*
o2
,
const
Transform3f
&
tf2
,
const
GJK
Solver
*
nsolver
,
const
DistanceRequest
&
request
,
DistanceResult
&
result
);
/// @brief each item in the distance matrix is a function to handle distance between objects of type1 and type2
...
...
include/hpp/fcl/math/transform.h
View file @
8fbd0cb6
...
...
@@ -48,6 +48,7 @@ namespace fcl
{
typedef
Eigen
::
Quaternion
<
FCL_REAL
>
Quaternion3f
;
static
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
Quaternion3f
&
q
)
{
o
<<
"("
<<
q
.
w
()
<<
" "
<<
q
.
x
()
<<
" "
<<
q
.
y
()
<<
" "
<<
q
.
z
()
<<
")"
;
...
...
@@ -258,10 +259,17 @@ public:
{
return
!
(
*
this
==
other
);
}
};
using
namespace
hpp
::
fcl
;
template
<
typename
Derived
>
inline
Quaternion3f
fromAxisAngle
(
const
Eigen
::
MatrixBase
<
Derived
>&
axis
,
FCL_REAL
angle
)
{
return
Quaternion3f
(
Eigen
::
AngleAxis
<
double
>
(
angle
,
axis
));
}
}
}
// namespace hpp
#endif
#endif
\ No newline at end of file
include/hpp/fcl/math/types.h
View file @
8fbd0cb6
...
...
@@ -42,18 +42,9 @@
#include
<Eigen/Core>
#include
<Eigen/Geometry>
#include
<hpp/fcl/math/tools.h>
#include
<cmath>
#include
<iostream>
#include
<limits>
namespace
hpp
{
namespace
fcl
{
typedef
Eigen
::
Matrix
<
FCL_REAL
,
3
,
1
>
Vec3f
;
}
#ifdef HPP_FCL_HAVE_OCTOMAP
#define OCTOMAP_VERSION_AT_LEAST(x,y,z) \
...
...
@@ -72,6 +63,7 @@ namespace hpp
{
namespace
fcl
{
typedef
Eigen
::
Matrix
<
FCL_REAL
,
3
,
1
>
Vec3f
;
typedef
Eigen
::
Matrix
<
FCL_REAL
,
3
,
3
>
Matrix3f
;
/// @brief Class for variance matrix in 3d
...
...
include/hpp/fcl/mesh_loader/loader.h
View file @
8fbd0cb6
...
...
@@ -97,7 +97,7 @@ namespace fcl {
};
typedef
std
::
map
<
Key
,
CollisionGeometryPtr_t
>
Cache_t
;
const
Cache_t
cache
()
const
{
return
cache_
;
}
private:
Cache_t
cache_
;
};
...
...
include/hpp/fcl/narrowphase/narrowphase.h
View file @
8fbd0cb6
...
...
@@ -50,7 +50,7 @@ namespace fcl
/// @brief collision and distance solver based on GJK algorithm implemented in fcl (rewritten the code from the GJK in bullet)
struct
GJKSolver
_indep
struct
GJKSolver
{
/// @brief intersection checking between two shapes
template
<
typename
S1
,
typename
S2
>
...
...
@@ -265,7 +265,7 @@ namespace fcl
}
/// @brief default setting for GJK algorithm
GJKSolver
_indep
()
GJKSolver
()
{
gjk_max_iterations
=
128
;
gjk_tolerance
=
1e-6
;
...
...
@@ -319,202 +319,202 @@ namespace fcl
/// @brief Fast implementation for sphere-capsule collision
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Sphere
,
Capsule
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Sphere
,
Capsule
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
const
Capsule
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Capsule
,
Sphere
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Capsule
,
Sphere
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
const
Sphere
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
/// @brief Fast implementation for sphere-sphere collision
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Sphere
,
Sphere
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Sphere
,
Sphere
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
const
Sphere
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
/// @brief Fast implementation for box-box collision
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Box
,
Box
>
(
const
Box
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Box
,
Box
>
(
const
Box
&
s1
,
const
Transform3f
&
tf1
,
const
Box
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Sphere
,
Halfspace
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Sphere
,
Halfspace
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
const
Halfspace
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Halfspace
,
Sphere
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Halfspace
,
Sphere
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
const
Sphere
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Box
,
Halfspace
>
(
const
Box
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Box
,
Halfspace
>
(
const
Box
&
s1
,
const
Transform3f
&
tf1
,
const
Halfspace
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Halfspace
,
Box
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Halfspace
,
Box
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
const
Box
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Capsule
,
Halfspace
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Capsule
,
Halfspace
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
const
Halfspace
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Halfspace
,
Capsule
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Halfspace
,
Capsule
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
const
Capsule
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Cylinder
,
Halfspace
>
(
const
Cylinder
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Cylinder
,
Halfspace
>
(
const
Cylinder
&
s1
,
const
Transform3f
&
tf1
,
const
Halfspace
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Halfspace
,
Cylinder
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Halfspace
,
Cylinder
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
const
Cylinder
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Cone
,
Halfspace
>
(
const
Cone
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Cone
,
Halfspace
>
(
const
Cone
&
s1
,
const
Transform3f
&
tf1
,
const
Halfspace
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Halfspace
,
Cone
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Halfspace
,
Cone
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
const
Cone
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Halfspace
,
Halfspace
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Halfspace
,
Halfspace
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
const
Halfspace
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Plane
,
Halfspace
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Plane
,
Halfspace
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
const
Halfspace
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Halfspace
,
Plane
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Halfspace
,
Plane
>
(
const
Halfspace
&
s1
,
const
Transform3f
&
tf1
,
const
Plane
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Sphere
,
Plane
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Sphere
,
Plane
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
const
Plane
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Plane
,
Sphere
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Plane
,
Sphere
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
const
Sphere
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Box
,
Plane
>
(
const
Box
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Box
,
Plane
>
(
const
Box
&
s1
,
const
Transform3f
&
tf1
,
const
Plane
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Plane
,
Box
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Plane
,
Box
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
const
Box
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Capsule
,
Plane
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Capsule
,
Plane
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
const
Plane
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Plane
,
Capsule
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Plane
,
Capsule
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
const
Capsule
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Cylinder
,
Plane
>
(
const
Cylinder
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Cylinder
,
Plane
>
(
const
Cylinder
&
s1
,
const
Transform3f
&
tf1
,
const
Plane
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Plane
,
Cylinder
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Plane
,
Cylinder
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
const
Cylinder
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Cone
,
Plane
>
(
const
Cone
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Cone
,
Plane
>
(
const
Cone
&
s1
,
const
Transform3f
&
tf1
,
const
Plane
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Plane
,
Cone
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Plane
,
Cone
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
const
Cone
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeIntersect
<
Plane
,
Plane
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
bool
GJKSolver
::
shapeIntersect
<
Plane
,
Plane
>
(
const
Plane
&
s1
,
const
Transform3f
&
tf1
,
const
Plane
&
s2
,
const
Transform3f
&
tf2
,
Vec3f
*
contact_points
,
FCL_REAL
*
penetration_depth
,
Vec3f
*
normal
)
const
;
/// @brief Fast implementation for sphere-triangle collision
template
<
>
bool
GJKSolver
_indep
::
shapeTriangleInteraction
bool
GJKSolver
::
shapeTriangleInteraction
(
const
Sphere
&
s
,
const
Transform3f
&
tf1
,
const
Vec3f
&
P1
,
const
Vec3f
&
P2
,
const
Vec3f
&
P3
,
const
Transform3f
&
tf2
,
FCL_REAL
&
distance
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeTriangleInteraction
bool
GJKSolver
::
shapeTriangleInteraction
(
const
Halfspace
&
s
,
const
Transform3f
&
tf1
,
const
Vec3f
&
P1
,
const
Vec3f
&
P2
,
const
Vec3f
&
P3
,
const
Transform3f
&
tf2
,
FCL_REAL
&
distance
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeTriangleInteraction
bool
GJKSolver
::
shapeTriangleInteraction
(
const
Plane
&
s
,
const
Transform3f
&
tf1
,
const
Vec3f
&
P1
,
const
Vec3f
&
P2
,
const
Vec3f
&
P3
,
const
Transform3f
&
tf2
,
FCL_REAL
&
distance
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
/// @brief Fast implementation for sphere-capsule distance
template
<
>
bool
GJKSolver
_indep
::
shapeDistance
<
Sphere
,
Capsule
>
bool
GJKSolver
::
shapeDistance
<
Sphere
,
Capsule
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
const
Capsule
&
s2
,
const
Transform3f
&
tf2
,
FCL_REAL
&
dist
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeDistance
<
Capsule
,
Sphere
>
bool
GJKSolver
::
shapeDistance
<
Capsule
,
Sphere
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
const
Sphere
&
s2
,
const
Transform3f
&
tf2
,
FCL_REAL
&
dist
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
/// @brief Fast implementation for sphere-cylinder distance
template
<
>
bool
GJKSolver
_indep
::
shapeDistance
<
Sphere
,
Cylinder
>
bool
GJKSolver
::
shapeDistance
<
Sphere
,
Cylinder
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
const
Cylinder
&
s2
,
const
Transform3f
&
tf2
,
FCL_REAL
&
dist
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
template
<
>
bool
GJKSolver
_indep
::
shapeDistance
<
Cylinder
,
Sphere
>
bool
GJKSolver
::
shapeDistance
<
Cylinder
,
Sphere
>
(
const
Cylinder
&
s1
,
const
Transform3f
&
tf1
,
const
Sphere
&
s2
,
const
Transform3f
&
tf2
,
FCL_REAL
&
dist
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
/// @brief Fast implementation for sphere-sphere distance
template
<
>
bool
GJKSolver
_indep
::
shapeDistance
<
Sphere
,
Sphere
>
bool
GJKSolver
::
shapeDistance
<
Sphere
,
Sphere
>
(
const
Sphere
&
s1
,
const
Transform3f
&
tf1
,
const
Sphere
&
s2
,
const
Transform3f
&
tf2
,
FCL_REAL
&
dist
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
// @brief Computation of the distance result for capsule capsule. Closest points are based on two line-segments.
template
<
>
bool
GJKSolver
_indep
::
shapeDistance
<
Capsule
,
Capsule
>
bool
GJKSolver
::
shapeDistance
<
Capsule
,
Capsule
>
(
const
Capsule
&
s1
,
const
Transform3f
&
tf1
,
const
Capsule
&
s2
,
const
Transform3f
&
tf2
,
FCL_REAL
&
dist
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
...
...
@@ -524,7 +524,7 @@ namespace fcl
// Do not run EPA algorithm to compute penetration depth, use a dedicated
// method.
template
<
>
bool
GJKSolver
_indep
::
shapeDistance
<
TriangleP
,
TriangleP
>
bool
GJKSolver
::
shapeDistance
<
TriangleP
,
TriangleP
>
(
const
TriangleP
&
s1
,
const
Transform3f
&
tf1
,
const
TriangleP
&
s2
,
const
Transform3f
&
tf2
,
FCL_REAL
&
dist
,
Vec3f
&
p1
,
Vec3f
&
p2
,
Vec3f
&
normal
)
const
;
...
...
include/hpp/fcl/traversal/traversal_node_bvh_shape.h
View file @
8fbd0cb6
...
...
@@ -146,7 +146,7 @@ public:
/// @brief Traversal node for collision between mesh and shape
template
<
typename
BV
,
typename
S
,
typename
NarrowPhase
Solver
,
template
<
typename
BV
,
typename
S
,
typename
GJK
Solver
,
int
_Options
=
RelativeTransformationIsIdentity
>
class
MeshShapeCollisionTraversalNode
:
public
BVHShapeCollisionTraversalNode
<
BV
,
S
>
{
...
...
@@ -256,50 +256,50 @@ public:
Vec3f
*
vertices
;
Triangle
*
tri_indices
;
const
NarrowPhase
Solver
*
nsolver
;
const
GJK
Solver
*
nsolver
;
};
/// @brief Traversal node for mesh and shape, when mesh BVH is one of the oriented node (OBB, RSS, OBBRSS, kIOS)
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
MeshShapeCollisionTraversalNodeOBB
:
public
MeshShapeCollisionTraversalNode
<
OBB
,
S
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
MeshShapeCollisionTraversalNodeOBB
:
public
MeshShapeCollisionTraversalNode
<
OBB
,
S
,
GJK
Solver
,
0
>
{
public:
MeshShapeCollisionTraversalNodeOBB
(
const
CollisionRequest
&
request
)
:
MeshShapeCollisionTraversalNode
<
OBB
,
S
,
NarrowPhase
Solver
,
0
>
MeshShapeCollisionTraversalNode
<
OBB
,
S
,
GJK
Solver
,
0
>
(
request
)
{
}
};
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
MeshShapeCollisionTraversalNodeRSS
:
public
MeshShapeCollisionTraversalNode
<
RSS
,
S
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
MeshShapeCollisionTraversalNodeRSS
:
public
MeshShapeCollisionTraversalNode
<
RSS
,
S
,
GJK
Solver
,
0
>
{
public:
MeshShapeCollisionTraversalNodeRSS
(
const
CollisionRequest
&
request
)
:
MeshShapeCollisionTraversalNode
<
RSS
,
S
,
NarrowPhase
Solver
,
0
>
MeshShapeCollisionTraversalNode
<
RSS
,
S
,
GJK
Solver
,
0
>
(
request
)
{
}
};
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
MeshShapeCollisionTraversalNodekIOS
:
public
MeshShapeCollisionTraversalNode
<
kIOS
,
S
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
MeshShapeCollisionTraversalNodekIOS
:
public
MeshShapeCollisionTraversalNode
<
kIOS
,
S
,
GJK
Solver
,
0
>
{
public:
MeshShapeCollisionTraversalNodekIOS
(
const
CollisionRequest
&
request
)
:
MeshShapeCollisionTraversalNode
<
kIOS
,
S
,
NarrowPhase
Solver
,
0
>
MeshShapeCollisionTraversalNode
<
kIOS
,
S
,
GJK
Solver
,
0
>
(
request
)
{
}
};
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
MeshShapeCollisionTraversalNodeOBBRSS
:
public
MeshShapeCollisionTraversalNode
<
OBBRSS
,
S
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
MeshShapeCollisionTraversalNodeOBBRSS
:
public
MeshShapeCollisionTraversalNode
<
OBBRSS
,
S
,
GJK
Solver
,
0
>
{
public:
MeshShapeCollisionTraversalNodeOBBRSS
(
const
CollisionRequest
&
request
)
:
MeshShapeCollisionTraversalNode
<
OBBRSS
,
S
,
NarrowPhase
Solver
,
0
>
MeshShapeCollisionTraversalNode
<
OBBRSS
,
S
,
GJK
Solver
,
0
>
(
request
)
{
}
...
...
@@ -307,7 +307,7 @@ public:
/// @brief Traversal node for collision between shape and mesh
template
<
typename
S
,
typename
BV
,
typename
NarrowPhase
Solver
,
template
<
typename
S
,
typename
BV
,
typename
GJK
Solver
,
int
_Options
=
RelativeTransformationIsIdentity
>
class
ShapeMeshCollisionTraversalNode
:
public
ShapeBVHCollisionTraversalNode
<
S
,
BV
>
{
...
...
@@ -416,45 +416,45 @@ public:
Vec3f
*
vertices
;
Triangle
*
tri_indices
;
const
NarrowPhase
Solver
*
nsolver
;
const
GJK
Solver
*
nsolver
;
};
/// @brief Traversal node for shape and mesh, when mesh BVH is one of the oriented node (OBB, RSS, OBBRSS, kIOS)
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
ShapeMeshCollisionTraversalNodeOBB
:
public
ShapeMeshCollisionTraversalNode
<
S
,
OBB
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
ShapeMeshCollisionTraversalNodeOBB
:
public
ShapeMeshCollisionTraversalNode
<
S
,
OBB
,
GJK
Solver
,
0
>
{
public:
ShapeMeshCollisionTraversalNodeOBB
()
:
ShapeMeshCollisionTraversalNode
<
S
,
OBB
,
NarrowPhase
Solver
>
()
ShapeMeshCollisionTraversalNodeOBB
()
:
ShapeMeshCollisionTraversalNode
<
S
,
OBB
,
GJK
Solver
>
()
{
}
};
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
ShapeMeshCollisionTraversalNodeRSS
:
public
ShapeMeshCollisionTraversalNode
<
S
,
RSS
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
ShapeMeshCollisionTraversalNodeRSS
:
public
ShapeMeshCollisionTraversalNode
<
S
,
RSS
,
GJK
Solver
,
0
>
{
public:
ShapeMeshCollisionTraversalNodeRSS
()
:
ShapeMeshCollisionTraversalNode
<
S
,
RSS
,
NarrowPhase
Solver
>
()
ShapeMeshCollisionTraversalNodeRSS
()
:
ShapeMeshCollisionTraversalNode
<
S
,
RSS
,
GJK
Solver
>
()
{
}
};
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
ShapeMeshCollisionTraversalNodekIOS
:
public
ShapeMeshCollisionTraversalNode
<
S
,
kIOS
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
ShapeMeshCollisionTraversalNodekIOS
:
public
ShapeMeshCollisionTraversalNode
<
S
,
kIOS
,
GJK
Solver
,
0
>
{
public:
ShapeMeshCollisionTraversalNodekIOS
()
:
ShapeMeshCollisionTraversalNode
<
S
,
kIOS
,
NarrowPhase
Solver
>
()
ShapeMeshCollisionTraversalNodekIOS
()
:
ShapeMeshCollisionTraversalNode
<
S
,
kIOS
,
GJK
Solver
>
()
{
}
};
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
ShapeMeshCollisionTraversalNodeOBBRSS
:
public
ShapeMeshCollisionTraversalNode
<
S
,
OBBRSS
,
NarrowPhase
Solver
,
0
>
template
<
typename
S
,
typename
GJK
Solver
>
class
ShapeMeshCollisionTraversalNodeOBBRSS
:
public
ShapeMeshCollisionTraversalNode
<
S
,
OBBRSS
,
GJK
Solver
,
0
>
{
public:
ShapeMeshCollisionTraversalNodeOBBRSS
()
:
ShapeMeshCollisionTraversalNode
<
S
,
OBBRSS
,
NarrowPhase
Solver
>
()
ShapeMeshCollisionTraversalNodeOBBRSS
()
:
ShapeMeshCollisionTraversalNode
<
S
,
OBBRSS
,
GJK
Solver
>
()
{
}
};
...
...
@@ -557,7 +557,7 @@ public: