Skip to content
GitLab
Menu
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
edea35f6
Commit
edea35f6
authored
Mar 31, 2020
by
Joseph Mirabel
Browse files
Propagate the API change of GJKSolver::shapeIntersect
parent
8085b371
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/hpp/fcl/internal/traversal_node_octree.h
View file @
edea35f6
...
...
@@ -304,7 +304,8 @@ private:
Transform3f
box_tf
;
constructBox
(
bv1
,
tf1
,
box
,
box_tf
);
if
(
solver
->
shapeIntersect
(
box
,
box_tf
,
s
,
tf2
,
NULL
,
NULL
,
NULL
))
FCL_REAL
distance
;
if
(
solver
->
shapeIntersect
(
box
,
box_tf
,
s
,
tf2
,
distance
,
false
,
NULL
,
NULL
))
{
AABB
overlap_part
;
AABB
aabb1
,
aabb2
;
...
...
@@ -328,9 +329,10 @@ private:
Transform3f
box_tf
;
constructBox
(
bv1
,
tf1
,
box
,
box_tf
);
FCL_REAL
distance
;
if
(
!
crequest
->
enable_contact
)
{
if
(
solver
->
shapeIntersect
(
box
,
box_tf
,
s
,
tf2
,
NULL
,
NULL
,
NULL
))
if
(
solver
->
shapeIntersect
(
box
,
box_tf
,
s
,
tf2
,
distance
,
false
,
NULL
,
NULL
))
{
if
(
cresult
->
numContacts
()
<
crequest
->
num_max_contacts
)
cresult
->
addContact
(
Contact
(
tree1
,
&
s
,
static_cast
<
int
>
(
root1
-
tree1
->
getRoot
()),
Contact
::
NONE
));
...
...
@@ -339,13 +341,12 @@ private:
else
{
Vec3f
contact
;
FCL_REAL
depth
;
Vec3f
normal
;
if
(
solver
->
shapeIntersect
(
box
,
box_tf
,
s
,
tf2
,
&
contact
,
&
depth
,
&
normal
))
if
(
solver
->
shapeIntersect
(
box
,
box_tf
,
s
,
tf2
,
distance
,
true
,
&
contact
,
&
normal
))
{
if
(
cresult
->
numContacts
()
<
crequest
->
num_max_contacts
)
cresult
->
addContact
(
Contact
(
tree1
,
&
s
,
static_cast
<
int
>
(
root1
-
tree1
->
getRoot
()),
Contact
::
NONE
,
contact
,
normal
,
d
epth
));
cresult
->
addContact
(
Contact
(
tree1
,
&
s
,
static_cast
<
int
>
(
root1
-
tree1
->
getRoot
()),
Contact
::
NONE
,
contact
,
normal
,
d
istance
));
}
}
...
...
@@ -819,12 +820,12 @@ private:
constructBox
(
bv2
,
tf2
,
box2
,
box2_tf
);
Vec3f
contact
;
FCL_REAL
d
epth
;
FCL_REAL
d
istance
;
Vec3f
normal
;
if
(
solver
->
shapeIntersect
(
box1
,
box1_tf
,
box2
,
box2_tf
,
&
contact
,
&
depth
,
&
normal
))
if
(
solver
->
shapeIntersect
(
box1
,
box1_tf
,
box2
,
box2_tf
,
distance
,
true
,
&
contact
,
&
normal
))
{
if
(
cresult
->
numContacts
()
<
crequest
->
num_max_contacts
)
cresult
->
addContact
(
Contact
(
tree1
,
tree2
,
static_cast
<
int
>
(
root1
-
tree1
->
getRoot
()),
static_cast
<
int
>
(
root2
-
tree2
->
getRoot
()),
contact
,
normal
,
d
epth
));
cresult
->
addContact
(
Contact
(
tree1
,
tree2
,
static_cast
<
int
>
(
root1
-
tree1
->
getRoot
()),
static_cast
<
int
>
(
root2
-
tree2
->
getRoot
()),
contact
,
normal
,
d
istance
));
}
}
...
...
include/hpp/fcl/internal/traversal_node_shapes.h
View file @
edea35f6
...
...
@@ -84,23 +84,26 @@ public:
void
leafCollides
(
int
,
int
,
FCL_REAL
&
)
const
{
bool
is_collision
=
false
;
if
(
request
.
enable_contact
)
FCL_REAL
distance
;
if
(
request
.
enable_contact
&&
request
.
num_max_contacts
>
result
->
numContacts
())
{
Vec3f
contact_point
,
normal
;
FCL_REAL
penetration_depth
;
if
(
nsolver
->
shapeIntersect
(
*
model1
,
tf1
,
*
model2
,
tf2
,
&
contact_point
,
&
penetration_depth
,
&
normal
))
if
(
nsolver
->
shapeIntersect
(
*
model1
,
tf1
,
*
model2
,
tf2
,
distance
,
true
,
&
contact_point
,
&
normal
))
{
is_collision
=
true
;
if
(
request
.
num_max_contacts
>
result
->
numContacts
())
result
->
addContact
(
Contact
(
model1
,
model2
,
Contact
::
NONE
,
Contact
::
NONE
,
contact_point
,
normal
,
penetration_depth
));
result
->
addContact
(
Contact
(
model1
,
model2
,
Contact
::
NONE
,
Contact
::
NONE
,
contact_point
,
normal
,
distance
));
}
}
else
{
if
(
nsolver
->
shapeIntersect
(
*
model1
,
tf1
,
*
model2
,
tf2
,
NULL
,
NULL
,
NULL
))
bool
res
=
nsolver
->
shapeIntersect
(
*
model1
,
tf1
,
*
model2
,
tf2
,
distance
,
request
.
enable_distance_lower_bound
,
NULL
,
NULL
);
if
(
request
.
enable_distance_lower_bound
)
result
->
updateDistanceLowerBound
(
distance
);
if
(
res
)
{
is_collision
=
true
;
if
(
request
.
num_max_contacts
>
result
->
numContacts
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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