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
aea29e11
Commit
aea29e11
authored
Mar 31, 2020
by
Joseph Mirabel
Browse files
Add CollisionRequest::updateDistanceLowerBound
parent
f2d4f45c
Changes
6
Hide whitespace changes
Inline
Side-by-side
include/hpp/fcl/collision_data.h
View file @
aea29e11
...
...
@@ -223,9 +223,16 @@ public:
public:
CollisionResult
()
:
distance_lower_bound
(
std
::
numeric_limits
<
FCL_REAL
>::
max
())
{
}
/// @brief Update the lower bound only if the distance in inferior.
inline
void
updateDistanceLowerBound
(
const
FCL_REAL
&
distance_lower_bound_
)
{
if
(
distance_lower_bound_
<
distance_lower_bound
)
distance_lower_bound
=
distance_lower_bound_
;
}
/// @brief add one contact into result structure
inline
void
addContact
(
const
Contact
&
c
)
...
...
src/collision.cpp
View file @
aea29e11
...
...
@@ -89,7 +89,6 @@ std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1,
solver
.
cached_guess
=
request
.
cached_gjk_guess
;
const
CollisionFunctionMatrix
&
looktable
=
getCollisionFunctionLookTable
();
result
.
distance_lower_bound
=
-
1
;
std
::
size_t
res
;
if
(
request
.
num_max_contacts
==
0
)
{
...
...
src/collision_func_matrix.cpp
View file @
aea29e11
...
...
@@ -109,7 +109,7 @@ std::size_t ShapeShapeCollide(const CollisionGeometry* o1, const Transform3f& tf
}
return
1
;
}
result
.
d
istance
_l
ower
_b
ound
=
distance
;
result
.
updateD
istance
L
ower
B
ound
(
distance
)
;
return
0
;
}
...
...
src/collision_node.cpp
View file @
aea29e11
...
...
@@ -60,7 +60,7 @@ void collide(CollisionTraversalNodeBase* node,
collisionRecurse
(
node
,
0
,
0
,
front_list
,
sqrDistLowerBound
);
else
collisionNonRecurse
(
node
,
front_list
,
sqrDistLowerBound
);
result
.
d
istance
_l
ower
_b
ound
=
sqrt
(
sqrDistLowerBound
);
result
.
updateD
istance
L
ower
B
ound
(
sqrt
(
sqrDistLowerBound
)
)
;
}
}
...
...
src/distance_sphere_sphere.cpp
View file @
aea29e11
...
...
@@ -132,7 +132,7 @@ namespace fcl {
result
.
addContact
(
contact
);
return
1
;
}
result
.
d
istance
_l
ower
_b
ound
=
-
penetrationDepth
;
result
.
updateD
istance
L
ower
B
ound
(
-
penetrationDepth
)
;
return
0
;
}
}
// namespace fcl
...
...
src/traversal/traversal_recurse.cpp
View file @
aea29e11
...
...
@@ -399,7 +399,7 @@ void propagateBVHFrontListCollisionRecurse
}
}
}
result
.
d
istance
_l
ower
_b
ound
=
sqrt
(
sqrDistLowerBound
);
result
.
updateD
istance
L
ower
B
ound
(
sqrt
(
sqrDistLowerBound
)
)
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment