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
dc6065d0
Commit
dc6065d0
authored
Sep 06, 2019
by
Lucile Remigy
Browse files
delete BVFitterBase and BVSplitterBase, come back of BVTesting and leafTesting
parent
7f436317
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
dc6065d0
...
...
@@ -127,14 +127,6 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/math/vec_3f.h
include/hpp/fcl/math/types.h
include/hpp/fcl/math/transform.h
include/hpp/fcl/traversal/details/traversal.h
include/hpp/fcl/traversal/traversal_node_shapes.h
include/hpp/fcl/traversal/traversal_node_setup.h
include/hpp/fcl/traversal/traversal_recurse.h
include/hpp/fcl/traversal/traversal_node_octree.h
include/hpp/fcl/traversal/traversal_node_bvhs.h
include/hpp/fcl/traversal/traversal_node_bvh_shape.h
include/hpp/fcl/traversal/traversal_node_base.h
include/hpp/fcl/data_types.h
include/hpp/fcl/BVH/BV_splitter.h
include/hpp/fcl/BVH/BVH_internal.h
...
...
include/hpp/fcl/BVH/BVH_model.h
View file @
dc6065d0
...
...
@@ -77,10 +77,10 @@ public:
BVHBuildState
build_state
;
/// @brief Split rule to split one BV node into two children
boost
::
shared_ptr
<
BVSplitter
Base
<
BV
>
>
bv_splitter
;
boost
::
shared_ptr
<
BVSplitter
<
BV
>
>
bv_splitter
;
/// @brief Fitting rule to fit a BV node to a set of geometry primitives
boost
::
shared_ptr
<
BVFitter
Base
<
BV
>
>
bv_fitter
;
boost
::
shared_ptr
<
BVFitter
Tpl
<
BV
>
>
bv_fitter
;
/// @brief Model type described by the instance
BVHModelType
getModelType
()
const
...
...
include/hpp/fcl/BVH/BV_fitter.h
View file @
dc6065d0
...
...
@@ -74,27 +74,9 @@ void fit<OBBRSS>(Vec3f* ps, int n, OBBRSS& bv);
template
<
>
void
fit
<
AABB
>
(
Vec3f
*
ps
,
int
n
,
AABB
&
bv
);
/// @brief Interface for fitting a bv given the triangles or points inside it.
template
<
typename
BV
>
class
BVFitterBase
{
public:
/// @brief Set the primitives to be processed by the fitter
virtual
void
set
(
Vec3f
*
vertices_
,
Triangle
*
tri_indices_
,
BVHModelType
type_
)
=
0
;
/// @brief Set the primitives to be processed by the fitter, for deformable mesh.
virtual
void
set
(
Vec3f
*
vertices_
,
Vec3f
*
prev_vertices_
,
Triangle
*
tri_indices_
,
BVHModelType
type_
)
=
0
;
/// @brief Compute the fitting BV
virtual
BV
fit
(
unsigned
int
*
primitive_indices
,
int
num_primitives
)
=
0
;
/// @brief clear the temporary data generated.
virtual
void
clear
()
=
0
;
};
/// @brief The class for the default algorithm fitting a bounding volume to a set of points
template
<
typename
BV
>
class
BVFitterTpl
:
public
BVFitterBase
<
BV
>
class
BVFitterTpl
{
public:
/// @brief default deconstructor
...
...
@@ -118,6 +100,9 @@ public:
type
=
type_
;
}
/// @brief Compute the fitting BV
virtual
BV
fit
(
unsigned
int
*
primitive_indices
,
int
num_primitives
)
=
0
;
/// @brief Clear the geometry primitive data
void
clear
()
{
...
...
include/hpp/fcl/BVH/BV_splitter.h
View file @
dc6065d0
...
...
@@ -49,32 +49,13 @@ namespace hpp
namespace
fcl
{
/// @brief Base interface for BV splitting algorithm
template
<
typename
BV
>
class
BVSplitterBase
{
public:
/// @brief Set the geometry data needed by the split rule
virtual
void
set
(
Vec3f
*
vertices_
,
Triangle
*
tri_indices_
,
BVHModelType
type_
)
=
0
;
/// @brief Compute the split rule according to a subset of geometry and the corresponding BV node
virtual
void
computeRule
(
const
BV
&
bv
,
unsigned
int
*
primitive_indices
,
int
num_primitives
)
=
0
;
/// @brief Apply the split rule on a given point
virtual
bool
apply
(
const
Vec3f
&
q
)
const
=
0
;
/// @brief Clear the geometry data set before
virtual
void
clear
()
=
0
;
};
/// @brief Three types of split algorithms are provided in FCL as default
enum
SplitMethodType
{
SPLIT_METHOD_MEAN
,
SPLIT_METHOD_MEDIAN
,
SPLIT_METHOD_BV_CENTER
};
/// @brief A class describing the split rule that splits each BV node
template
<
typename
BV
>
class
BVSplitter
:
public
BVSplitterBase
<
BV
>
class
BVSplitter
{
public:
...
...
src/collision_func_matrix.cpp
View file @
dc6065d0
This diff is collapsed.
Click to expand it.
src/collision_node.cpp
View file @
dc6065d0
...
...
@@ -37,7 +37,7 @@
#include
<../src/collision_node.h>
#include
<hpp/fcl/
traversal/traversal_recurse.h
>
#include
"
traversal/traversal_recurse.h
"
namespace
hpp
{
...
...
src/collision_node.h
View file @
dc6065d0
...
...
@@ -39,8 +39,8 @@
#ifndef HPP_FCL_COLLISION_NODE_H
#define HPP_FCL_COLLISION_NODE_H
#include
<hpp/fcl/
traversal/traversal_node_base.h
>
#include
<hpp/fcl/
traversal/traversal_node_bvhs.h
>
#include
"
traversal/traversal_node_base.h
"
#include
"
traversal/traversal_node_bvhs.h
"
#include
<hpp/fcl/BVH/BVH_front.h>
...
...
src/distance_func_matrix.cpp
View file @
dc6065d0
...
...
@@ -38,7 +38,7 @@
#include
<hpp/fcl/distance_func_matrix.h>
#include
<../src/collision_node.h>
#include
<hpp/fcl/
traversal/traversal_node_setup.h
>
#include
"
traversal/traversal_node_setup.h
"
#include
<hpp/fcl/narrowphase/narrowphase.h>
namespace
hpp
...
...
src/narrowphase/details.h
View file @
dc6065d0
...
...
@@ -38,7 +38,7 @@
#ifndef HPP_FCL_SRC_NARROWPHASE_DETAILS_H
# define HPP_FCL_SRC_NARROWPHASE_DETAILS_H
#include
<hpp/fcl
/traversal/traversal_node_setup.h
>
#include
"..
/traversal/traversal_node_setup.h
"
#include
<hpp/fcl/narrowphase/narrowphase.h>
namespace
hpp
...
...
include/hpp/fcl
/traversal/details/traversal.h
→
src
/traversal/details/traversal.h
View file @
dc6065d0
File moved
src/traversal/traversal_node_base.cpp
View file @
dc6065d0
...
...
@@ -36,7 +36,7 @@
/** \author Jia Pan */
#include
<hpp/fcl/traversal/
traversal_node_base.h
>
#include
"
traversal_node_base.h
"
#include
<limits>
namespace
hpp
...
...
@@ -97,7 +97,7 @@ DistanceTraversalNodeBase::~DistanceTraversalNodeBase()
{
}
FCL_REAL
DistanceTraversalNodeBase
::
BV
Disjoints
(
int
/*b1*/
,
int
/*b2*/
)
const
FCL_REAL
DistanceTraversalNodeBase
::
BV
Testing
(
int
/*b1*/
,
int
/*b2*/
)
const
{
return
std
::
numeric_limits
<
FCL_REAL
>::
max
();
}
...
...
include/hpp/fcl
/traversal/traversal_node_base.h
→
src
/traversal/traversal_node_base.h
View file @
dc6065d0
...
...
@@ -139,10 +139,10 @@ public:
/// @brief BV test between b1 and b2
/// \return a lower bound of the distance between the two BV.
/// \note except for OBB, this method returns the distance.
virtual
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
;
virtual
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
;
/// @brief Leaf test between node b1 and b2, if they are both leafs
virtual
void
leaf
Collides
(
int
b1
,
int
b2
)
const
=
0
;
virtual
void
leaf
Testing
(
int
b1
,
int
b2
)
const
=
0
;
/// @brief Check whether the traversal can stop
virtual
bool
canStop
(
FCL_REAL
c
)
const
;
...
...
include/hpp/fcl
/traversal/traversal_node_bvh_shape.h
→
src
/traversal/traversal_node_bvh_shape.h
View file @
dc6065d0
...
...
@@ -42,8 +42,8 @@
#include
<hpp/fcl/collision_data.h>
#include
<hpp/fcl/shape/geometric_shapes.h>
#include
<hpp/fcl/shape/geometric_shapes_utility.h>
#include
<hpp/fcl/traversal/
traversal_node_base.h
>
#include
<hpp/fcl/traversal/
details/traversal.h
>
#include
"
traversal_node_base.h
"
#include
"
details/traversal.h
"
#include
<hpp/fcl/BVH/BVH_model.h>
...
...
@@ -166,7 +166,7 @@ public:
}
/// @brief BV culling test in one BVTT node
bool
BV
Disjoints
(
int
b1
,
int
/*b2*/
)
const
bool
BV
Testing
(
int
b1
,
int
/*b2*/
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
if
(
RTIsIdentity
)
...
...
@@ -180,7 +180,7 @@ public:
/// \retval sqrDistLowerBound square of a lower bound of the minimal
/// distance between bounding volumes.
/// @brief BV culling test in one BVTT node
bool
BV
Disjoints
(
int
b1
,
int
/*b2*/
,
FCL_REAL
&
sqrDistLowerBound
)
const
bool
BV
Testing
(
int
b1
,
int
/*b2*/
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
bool
res
;
...
...
@@ -195,7 +195,7 @@ public:
}
/// @brief Intersection testing between leaves (one triangle and one shape)
void
leaf
Collides
(
int
b1
,
int
/*b2*/
,
FCL_REAL
&
sqrDistLowerBound
)
const
void
leaf
Testing
(
int
b1
,
int
/*b2*/
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_leaf_tests
++
;
const
BVNode
<
BV
>&
node
=
this
->
model1
->
getBV
(
b1
);
...
...
@@ -327,7 +327,7 @@ public:
/// BV test between b1 and b2
/// \param b2 Bounding volumes to test,
bool
BV
Disjoints
(
int
/*b1*/
,
int
b2
)
const
bool
BV
Testing
(
int
/*b1*/
,
int
b2
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
if
(
RTIsIdentity
)
...
...
@@ -340,7 +340,7 @@ public:
/// \param b2 Bounding volumes to test,
/// \retval sqrDistLowerBound square of a lower bound of the minimal
/// distance between bounding volumes.
bool
BV
Disjoints
(
int
/*b1*/
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
bool
BV
Testing
(
int
/*b1*/
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
bool
res
;
...
...
@@ -355,7 +355,7 @@ public:
}
/// @brief Intersection testing between leaves (one shape and one triangle)
void
leaf
Collides
(
int
/*b1*/
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
void
leaf
Testing
(
int
/*b1*/
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_leaf_tests
++
;
const
BVNode
<
BV
>&
node
=
this
->
model2
->
getBV
(
b2
);
...
...
@@ -493,7 +493,7 @@ public:
}
/// @brief BV culling test in one BVTT node
FCL_REAL
BV
Disjoints
(
int
b1
,
int
/*b2*/
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
/*b2*/
)
const
{
return
model1
->
getBV
(
b1
).
bv
.
distance
(
model2_bv
);
}
...
...
@@ -541,7 +541,7 @@ public:
}
/// @brief BV culling test in one BVTT node
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
{
return
model1_bv
.
distance
(
model2
->
getBV
(
b2
).
bv
);
}
...
...
@@ -573,7 +573,7 @@ public:
}
/// @brief Distance testing between leaves (one triangle and one shape)
void
leaf
Collides
(
int
b1
,
int
/*b2*/
)
const
void
leaf
Testing
(
int
b1
,
int
/*b2*/
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_leaf_tests
++
;
...
...
@@ -700,13 +700,13 @@ public:
{
}
FCL_REAL
BV
Disjoints
(
int
b1
,
int
/*b2*/
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
/*b2*/
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
return
distance
(
this
->
tf1
.
getRotation
(),
this
->
tf1
.
getTranslation
(),
this
->
model2_bv
,
this
->
model1
->
getBV
(
b1
).
bv
);
}
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
details
::
meshShapeDistanceOrientedNodeLeafTesting
(
b1
,
b2
,
this
->
model1
,
*
(
this
->
model2
),
this
->
vertices
,
this
->
tri_indices
,
this
->
tf1
,
this
->
tf2
,
this
->
nsolver
,
this
->
enable_statistics
,
this
->
num_leaf_tests
,
this
->
request
,
*
(
this
->
result
));
...
...
@@ -732,13 +732,13 @@ public:
{
}
FCL_REAL
BV
Disjoints
(
int
b1
,
int
/*b2*/
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
/*b2*/
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
return
distance
(
this
->
tf1
.
getRotation
(),
this
->
tf1
.
getTranslation
(),
this
->
model2_bv
,
this
->
model1
->
getBV
(
b1
).
bv
);
}
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
details
::
meshShapeDistanceOrientedNodeLeafTesting
(
b1
,
b2
,
this
->
model1
,
*
(
this
->
model2
),
this
->
vertices
,
this
->
tri_indices
,
this
->
tf1
,
this
->
tf2
,
this
->
nsolver
,
this
->
enable_statistics
,
this
->
num_leaf_tests
,
this
->
request
,
*
(
this
->
result
));
...
...
@@ -746,11 +746,11 @@ public:
};
template
<
typename
S
,
typename
GJK
Solver
>
class
MeshShapeDistanceTraversalNodeOBBRSS
:
public
MeshShapeDistanceTraversalNode
<
OBBRSS
,
S
,
GJK
Solver
>
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
MeshShapeDistanceTraversalNodeOBBRSS
:
public
MeshShapeDistanceTraversalNode
<
OBBRSS
,
S
,
NarrowPhase
Solver
>
{
public:
MeshShapeDistanceTraversalNodeOBBRSS
()
:
MeshShapeDistanceTraversalNode
<
OBBRSS
,
S
,
GJK
Solver
>
()
MeshShapeDistanceTraversalNodeOBBRSS
()
:
MeshShapeDistanceTraversalNode
<
OBBRSS
,
S
,
NarrowPhase
Solver
>
()
{
}
...
...
@@ -765,13 +765,13 @@ public:
}
FCL_REAL
BV
Disjoints
(
int
b1
,
int
/*b2*/
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
/*b2*/
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
return
distance
(
this
->
tf1
.
getRotation
(),
this
->
tf1
.
getTranslation
(),
this
->
model2_bv
,
this
->
model1
->
getBV
(
b1
).
bv
);
}
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
details
::
meshShapeDistanceOrientedNodeLeafTesting
(
b1
,
b2
,
this
->
model1
,
*
(
this
->
model2
),
this
->
vertices
,
this
->
tri_indices
,
this
->
tf1
,
this
->
tf2
,
this
->
nsolver
,
this
->
enable_statistics
,
this
->
num_leaf_tests
,
this
->
request
,
*
(
this
->
result
));
...
...
@@ -780,7 +780,7 @@ public:
};
/// @brief Traversal node for distance between shape and mesh
template
<
typename
S
,
typename
BV
,
typename
GJK
Solver
>
template
<
typename
S
,
typename
BV
,
typename
NarrowPhase
Solver
>
class
ShapeMeshDistanceTraversalNode
:
public
ShapeBVHDistanceTraversalNode
<
S
,
BV
>
{
public:
...
...
@@ -796,7 +796,7 @@ public:
}
/// @brief Distance testing between leaves (one shape and one triangle)
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_leaf_tests
++
;
...
...
@@ -835,14 +835,14 @@ public:
FCL_REAL
rel_err
;
FCL_REAL
abs_err
;
const
GJK
Solver
*
nsolver
;
const
NarrowPhase
Solver
*
nsolver
;
};
template
<
typename
S
,
typename
GJK
Solver
>
class
ShapeMeshDistanceTraversalNodeRSS
:
public
ShapeMeshDistanceTraversalNode
<
S
,
RSS
,
GJK
Solver
>
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
ShapeMeshDistanceTraversalNodeRSS
:
public
ShapeMeshDistanceTraversalNode
<
S
,
RSS
,
NarrowPhase
Solver
>
{
public:
ShapeMeshDistanceTraversalNodeRSS
()
:
ShapeMeshDistanceTraversalNode
<
S
,
RSS
,
GJK
Solver
>
()
ShapeMeshDistanceTraversalNodeRSS
()
:
ShapeMeshDistanceTraversalNode
<
S
,
RSS
,
NarrowPhase
Solver
>
()
{
}
...
...
@@ -856,13 +856,13 @@ public:
{
}
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
return
distance
(
this
->
tf2
.
getRotation
(),
this
->
tf2
.
getTranslation
(),
this
->
model1_bv
,
this
->
model2
->
getBV
(
b2
).
bv
);
}
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
details
::
meshShapeDistanceOrientedNodeLeafTesting
(
b2
,
b1
,
this
->
model2
,
*
(
this
->
model1
),
this
->
vertices
,
this
->
tri_indices
,
this
->
tf2
,
this
->
tf1
,
this
->
nsolver
,
this
->
enable_statistics
,
this
->
num_leaf_tests
,
this
->
request
,
*
(
this
->
result
));
...
...
@@ -870,11 +870,11 @@ public:
};
template
<
typename
S
,
typename
GJK
Solver
>
class
ShapeMeshDistanceTraversalNodekIOS
:
public
ShapeMeshDistanceTraversalNode
<
S
,
kIOS
,
GJK
Solver
>
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
ShapeMeshDistanceTraversalNodekIOS
:
public
ShapeMeshDistanceTraversalNode
<
S
,
kIOS
,
NarrowPhase
Solver
>
{
public:
ShapeMeshDistanceTraversalNodekIOS
()
:
ShapeMeshDistanceTraversalNode
<
S
,
kIOS
,
GJK
Solver
>
()
ShapeMeshDistanceTraversalNodekIOS
()
:
ShapeMeshDistanceTraversalNode
<
S
,
kIOS
,
NarrowPhase
Solver
>
()
{
}
...
...
@@ -888,13 +888,13 @@ public:
{
}
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
return
distance
(
this
->
tf2
.
getRotation
(),
this
->
tf2
.
getTranslation
(),
this
->
model1_bv
,
this
->
model2
->
getBV
(
b2
).
bv
);
}
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
details
::
meshShapeDistanceOrientedNodeLeafTesting
(
b2
,
b1
,
this
->
model2
,
*
(
this
->
model1
),
this
->
vertices
,
this
->
tri_indices
,
this
->
tf2
,
this
->
tf1
,
this
->
nsolver
,
this
->
enable_statistics
,
this
->
num_leaf_tests
,
this
->
request
,
*
(
this
->
result
));
...
...
@@ -902,11 +902,11 @@ public:
};
template
<
typename
S
,
typename
GJK
Solver
>
class
ShapeMeshDistanceTraversalNodeOBBRSS
:
public
ShapeMeshDistanceTraversalNode
<
S
,
OBBRSS
,
GJK
Solver
>
template
<
typename
S
,
typename
NarrowPhase
Solver
>
class
ShapeMeshDistanceTraversalNodeOBBRSS
:
public
ShapeMeshDistanceTraversalNode
<
S
,
OBBRSS
,
NarrowPhase
Solver
>
{
public:
ShapeMeshDistanceTraversalNodeOBBRSS
()
:
ShapeMeshDistanceTraversalNode
<
S
,
OBBRSS
,
GJK
Solver
>
()
ShapeMeshDistanceTraversalNodeOBBRSS
()
:
ShapeMeshDistanceTraversalNode
<
S
,
OBBRSS
,
NarrowPhase
Solver
>
()
{
}
...
...
@@ -920,13 +920,13 @@ public:
{
}
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
return
distance
(
this
->
tf2
.
getRotation
(),
this
->
tf2
.
getTranslation
(),
this
->
model1_bv
,
this
->
model2
->
getBV
(
b2
).
bv
);
}
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
details
::
meshShapeDistanceOrientedNodeLeafTesting
(
b2
,
b1
,
this
->
model2
,
*
(
this
->
model1
),
this
->
vertices
,
this
->
tri_indices
,
this
->
tf2
,
this
->
tf1
,
this
->
nsolver
,
this
->
enable_statistics
,
this
->
num_leaf_tests
,
this
->
request
,
*
(
this
->
result
));
...
...
src/traversal/traversal_node_bvhs.cpp
View file @
dc6065d0
...
...
@@ -36,7 +36,7 @@
/** \author Jia Pan */
#include
<hpp/fcl/traversal/
traversal_node_bvhs.h
>
#include
"
traversal_node_bvhs.h
"
namespace
hpp
{
...
...
@@ -46,7 +46,7 @@ namespace fcl
namespace
details
{
template
<
typename
BV
>
static
inline
void
meshDistanceOrientedNode
L
eafTesting
(
int
b1
,
int
b2
,
static
inline
void
meshDistanceOrientedNode
l
eafTesting
(
int
b1
,
int
b2
,
const
BVHModel
<
BV
>*
model1
,
const
BVHModel
<
BV
>*
model2
,
Vec3f
*
vertices1
,
Vec3f
*
vertices2
,
Triangle
*
tri_indices1
,
Triangle
*
tri_indices2
,
...
...
@@ -152,7 +152,7 @@ void MeshDistanceTraversalNodeRSS::postprocess()
details
::
distancePostprocessOrientedNode
(
model1
,
model2
,
tf1
,
request
,
*
result
);
}
FCL_REAL
MeshDistanceTraversalNodeRSS
::
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
MeshDistanceTraversalNodeRSS
::
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
enable_statistics
)
num_bv_tests
++
;
return
distance
(
R
,
T
,
model1
->
getBV
(
b1
).
bv
,
model2
->
getBV
(
b2
).
bv
);
...
...
@@ -160,7 +160,7 @@ FCL_REAL MeshDistanceTraversalNodeRSS::BVDisjoints(int b1, int b2) const
void
MeshDistanceTraversalNodeRSS
::
leafTesting
(
int
b1
,
int
b2
)
const
{
details
::
meshDistanceOrientedNode
L
eafTesting
(
b1
,
b2
,
model1
,
model2
,
vertices1
,
vertices2
,
tri_indices1
,
tri_indices2
,
details
::
meshDistanceOrientedNode
l
eafTesting
(
b1
,
b2
,
model1
,
model2
,
vertices1
,
vertices2
,
tri_indices1
,
tri_indices2
,
R
,
T
,
enable_statistics
,
num_leaf_tests
,
request
,
*
result
);
}
...
...
@@ -180,7 +180,7 @@ void MeshDistanceTraversalNodekIOS::postprocess()
details
::
distancePostprocessOrientedNode
(
model1
,
model2
,
tf1
,
request
,
*
result
);
}
FCL_REAL
MeshDistanceTraversalNodekIOS
::
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
MeshDistanceTraversalNodekIOS
::
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
enable_statistics
)
num_bv_tests
++
;
return
distance
(
R
,
T
,
model1
->
getBV
(
b1
).
bv
,
model2
->
getBV
(
b2
).
bv
);
...
...
@@ -188,7 +188,7 @@ FCL_REAL MeshDistanceTraversalNodekIOS::BVDisjoints(int b1, int b2) const
void
MeshDistanceTraversalNodekIOS
::
leafTesting
(
int
b1
,
int
b2
)
const
{
details
::
meshDistanceOrientedNode
L
eafTesting
(
b1
,
b2
,
model1
,
model2
,
vertices1
,
vertices2
,
tri_indices1
,
tri_indices2
,
details
::
meshDistanceOrientedNode
l
eafTesting
(
b1
,
b2
,
model1
,
model2
,
vertices1
,
vertices2
,
tri_indices1
,
tri_indices2
,
R
,
T
,
enable_statistics
,
num_leaf_tests
,
request
,
*
result
);
}
...
...
@@ -208,7 +208,7 @@ void MeshDistanceTraversalNodeOBBRSS::postprocess()
details
::
distancePostprocessOrientedNode
(
model1
,
model2
,
tf1
,
request
,
*
result
);
}
FCL_REAL
MeshDistanceTraversalNodeOBBRSS
::
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
MeshDistanceTraversalNodeOBBRSS
::
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
enable_statistics
)
num_bv_tests
++
;
return
distance
(
R
,
T
,
model1
->
getBV
(
b1
).
bv
,
model2
->
getBV
(
b2
).
bv
);
...
...
@@ -216,7 +216,7 @@ FCL_REAL MeshDistanceTraversalNodeOBBRSS::BVDisjoints(int b1, int b2) const
void
MeshDistanceTraversalNodeOBBRSS
::
leafTesting
(
int
b1
,
int
b2
)
const
{
details
::
meshDistanceOrientedNode
L
eafTesting
(
b1
,
b2
,
model1
,
model2
,
vertices1
,
vertices2
,
tri_indices1
,
tri_indices2
,
details
::
meshDistanceOrientedNode
l
eafTesting
(
b1
,
b2
,
model1
,
model2
,
vertices1
,
vertices2
,
tri_indices1
,
tri_indices2
,
R
,
T
,
enable_statistics
,
num_leaf_tests
,
request
,
*
result
);
}
...
...
include/hpp/fcl
/traversal/traversal_node_bvhs.h
→
src
/traversal/traversal_node_bvhs.h
View file @
dc6065d0
...
...
@@ -40,14 +40,14 @@
#define HPP_FCL_TRAVERSAL_NODE_MESHES_H
#include
<hpp/fcl/collision_data.h>
#include
<hpp/fcl/traversal/
traversal_node_base.h
>
#include
"
traversal_node_base.h
"
#include
<hpp/fcl/BV/BV_node.h>
#include
<hpp/fcl/BV/BV.h>
#include
<hpp/fcl/BVH/BVH_model.h>
#include
<hpp/fcl/intersect.h>
#include
<hpp/fcl/shape/geometric_shapes.h>
#include
<hpp/fcl/narrowphase/narrowphase.h>
#include
<hpp/fcl/traversal/
details/traversal.h
>
#include
"
details/traversal.h
"
#include
<boost/shared_array.hpp>
#include
<boost/shared_ptr.hpp>
...
...
@@ -157,7 +157,7 @@ public:
}
/// @brief BV culling test in one BVTT node
bool
BV
Disjoints
(
int
b1
,
int
b2
)
const
bool
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
if
(
RTIsIdentity
)
...
...
@@ -171,7 +171,7 @@ public:
/// \param b1, b2 Bounding volumes to test,
/// \retval sqrDistLowerBound square of a lower bound of the minimal
/// distance between bounding volumes.
bool
BV
Disjoints
(
int
b1
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
bool
BV
Testing
(
int
b1
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_bv_tests
++
;
if
(
RTIsIdentity
)
...
...
@@ -200,7 +200,7 @@ public:
/// \note If the distance between objects is less than the security margin,
/// and the object are not colliding, the penetration depth is
/// negative.
void
leaf
Collides
(
int
b1
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
void
leaf
Testing
(
int
b1
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_leaf_tests
++
;
...
...
@@ -361,7 +361,7 @@ public:
}
/// @brief BV culling test in one BVTT node
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
{
if
(
enable_statistics
)
num_bv_tests
++
;
return
details
::
DistanceTraversalBVTesting_impl
<
BV
>
...
...
@@ -397,7 +397,7 @@ public:
}
/// @brief Distance testing between leaves (two triangles)
void
leaf
Collides
(
int
b1
,
int
b2
)
const
void
leaf
Testing
(
int
b1
,
int
b2
)
const
{
if
(
this
->
enable_statistics
)
this
->
num_leaf_tests
++
;
...
...
@@ -457,7 +457,7 @@ public:
void
postprocess
();
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
;
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
;
void
leafTesting
(
int
b1
,
int
b2
)
const
;
...
...
@@ -475,7 +475,7 @@ public:
void
postprocess
();
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
;
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
;
void
leafTesting
(
int
b1
,
int
b2
)
const
;
...
...
@@ -492,9 +492,9 @@ public:
void
postprocess
();
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
)
const
;
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
)
const
;
FCL_REAL
BV
Disjoints
(
int
b1
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
;
FCL_REAL
BV
Testing
(
int
b1
,
int
b2
,
FCL_REAL
&
sqrDistLowerBound
)
const
;
void
leafTesting
(
int
b1
,
int
b2
)
const
;
...
...
@@ -525,4 +525,4 @@ inline const Matrix3f& getBVAxes<OBBRSS>(const OBBRSS& bv)
}
// namespace hpp