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
11c6b0eb
Commit
11c6b0eb
authored
Aug 30, 2019
by
Joseph Mirabel
Browse files
[GJK] rank is of type short int.
parent
b4d102f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/hpp/fcl/narrowphase/gjk.h
View file @
11c6b0eb
...
...
@@ -125,7 +125,7 @@ struct GJK
/// @brief weight
FCL_REAL
coefficient
[
4
];
/// @brief size of simplex (number of vertices)
s
ize_
t
rank
;
s
hor
t
rank
;
Simplex
()
:
rank
(
0
)
{}
};
...
...
include/hpp/fcl/narrowphase/narrowphase.h
View file @
11c6b0eb
...
...
@@ -128,7 +128,7 @@ namespace fcl
details
::
EPA
::
Status
epa_status
=
epa
.
evaluate
(
gjk
,
-
guess
);
assert
(
epa_status
!=
details
::
EPA
::
Failed
);
(
void
)
epa_status
;
Vec3f
w0
(
Vec3f
::
Zero
());
for
(
s
ize_
t
i
=
0
;
i
<
epa
.
result
.
rank
;
++
i
)
for
(
s
hor
t
i
=
0
;
i
<
epa
.
result
.
rank
;
++
i
)
{
w0
+=
epa
.
result
.
vertex
[
i
]
->
w0
*
epa
.
result
.
coefficient
[
i
];
}
...
...
@@ -217,7 +217,7 @@ namespace fcl
if
(
epa_status
!=
details
::
EPA
::
Failed
)
{
Vec3f
w0
(
Vec3f
::
Zero
());
for
(
s
ize_
t
i
=
0
;
i
<
epa
.
result
.
rank
;
++
i
)
for
(
s
hor
t
i
=
0
;
i
<
epa
.
result
.
rank
;
++
i
)
{
w0
+=
epa
.
result
.
vertex
[
i
]
->
w0
*
epa
.
result
.
coefficient
[
i
];
}
...
...
src/narrowphase/gjk.cpp
View file @
11c6b0eb
...
...
@@ -312,7 +312,7 @@ bool GJK::getClosestPoints (const MinkowskiDiff& shape, Vec3f& w0, Vec3f& w1) co
{
w0
.
setZero
();
w1
.
setZero
();
for
(
s
ize_
t
i
=
0
;
i
<
getSimplex
()
->
rank
;
++
i
)
for
(
s
hor
t
i
=
0
;
i
<
getSimplex
()
->
rank
;
++
i
)
{
FCL_REAL
p
=
getSimplex
()
->
coefficient
[
i
];
w0
+=
getSimplex
()
->
vertex
[
i
]
->
w0
*
p
;
...
...
@@ -391,8 +391,8 @@ GJK::Status GJK::evaluate(const MinkowskiDiff& shape_, const Vec3f& guess)
assert
(
fabs
(
d
-
project_res
.
sqr_distance
)
<
1e-10
);
Vec3f
_ray
(
0
,
0
,
0
);
s
ize_
t
k
=
0
;
for
(
s
ize_
t
i
=
0
;
i
<
curr_simplex
.
rank
;
++
i
)
s
hor
t
k
=
0
;
for
(
s
hor
t
i
=
0
;
i
<
curr_simplex
.
rank
;
++
i
)
{
if
(
project_res
.
encode
&
(
1
<<
i
))
{
...
...
@@ -418,8 +418,8 @@ GJK::Status GJK::evaluate(const MinkowskiDiff& shape_, const Vec3f& guess)
assert
(
fabs
(
d
-
project_res
.
sqr_distance
)
<
1e-10
);
Vec3f
_ray
(
0
,
0
,
0
);
s
ize_
t
k
=
0
;
for
(
s
ize_
t
i
=
0
;
i
<
curr_simplex
.
rank
;
++
i
)
s
hor
t
k
=
0
;
for
(
s
hor
t
i
=
0
;
i
<
curr_simplex
.
rank
;
++
i
)
{
if
(
project_res
.
encode
&
(
1
<<
i
))
{
...
...
@@ -447,7 +447,7 @@ GJK::Status GJK::evaluate(const MinkowskiDiff& shape_, const Vec3f& guess)
if
(
curr_simplex
.
rank
>
3
)
{
next_simplex
.
rank
=
0
;
ray
=
Vec3f
(
0
,
0
,
0
);
for
(
s
ize_
t
i
=
0
;
i
<
curr_simplex
.
rank
;
++
i
)
for
(
s
hor
t
i
=
0
;
i
<
curr_simplex
.
rank
;
++
i
)
{
if
(
project_res
.
encode
&
(
1
<<
i
))
{
...
...
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