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
580334d1
Commit
580334d1
authored
May 10, 2017
by
Joseph Mirabel
Committed by
Joseph Mirabel
May 10, 2017
Browse files
Fix sphereSphereDistance
parent
66bf5d4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/narrowphase/narrowphase.cpp
View file @
580334d1
...
...
@@ -176,9 +176,9 @@ bool sphereSphereDistance(const Sphere& s1, const Transform3f& tf1,
Vec3f
o2
=
tf2
.
getTranslation
();
Vec3f
diff
=
o1
-
o2
;
FCL_REAL
len
=
diff
.
norm
();
FCL_REAL
d
(
len
>
s1
.
radius
+
s2
.
radius
);
FCL_REAL
d
(
len
-
s1
.
radius
-
s2
.
radius
);
if
(
dist
)
*
dist
=
len
-
(
s1
.
radius
+
s2
.
radius
)
;
if
(
dist
)
*
dist
=
d
;
if
(
p1
)
*
p1
=
o1
-
diff
*
(
s1
.
radius
/
len
);
if
(
p2
)
*
p2
=
o2
+
diff
*
(
s2
.
radius
/
len
);
...
...
Write
Preview
Markdown
is supported
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