Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
iMSTK
iMSTK
Commits
6cb1b2ee
Commit
6cb1b2ee
authored
Jul 27, 2019
by
Nghia Truong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: Fix point-triangle distance computation
parent
54b8e022
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Source/Collision/CollisionDetection/imstkCollisionUtils.cpp
Source/Collision/CollisionDetection/imstkCollisionUtils.cpp
+2
-2
No files found.
Source/Collision/CollisionDetection/imstkCollisionUtils.cpp
View file @
6cb1b2ee
...
...
@@ -170,7 +170,7 @@ pointSegmentClosestDistance(const Vec3r& point, const Vec3r& x1, const Vec3r& x2
s12
=
1.0
;
}
return
(
point
-
s12
*
x1
+
(
1.0
-
s12
)
*
x2
).
norm
();
return
(
point
-
(
s12
*
x1
+
(
1.0
-
s12
)
*
x2
)
).
eval
()
.
norm
();
}
Real
...
...
@@ -190,7 +190,7 @@ pointTriangleClosestDistance(const Vec3r& point, const Vec3r& x1, const Vec3r& x
if
(
w23
>=
0
&&
w31
>=
0
&&
w12
>=
0
)
// inside the triangle
{
return
(
point
-
w23
*
x1
+
w31
*
x2
+
w12
*
x3
).
norm
();
return
(
point
-
(
w23
*
x1
+
w31
*
x2
+
w12
*
x3
)
).
eval
()
.
norm
();
}
else
{
...
...
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