Commit 11c6b0eb authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[GJK] rank is of type short int.

parent b4d102f5
......@@ -125,7 +125,7 @@ struct GJK
/// @brief weight
FCL_REAL coefficient[4];
/// @brief size of simplex (number of vertices)
size_t rank;
short rank;
Simplex() : rank(0) {}
};
......
......@@ -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(size_t i = 0; i < epa.result.rank; ++i)
for(short 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(size_t i = 0; i < epa.result.rank; ++i)
for(short i = 0; i < epa.result.rank; ++i)
{
w0 += epa.result.vertex[i]->w0 * epa.result.coefficient[i];
}
......
......@@ -312,7 +312,7 @@ bool GJK::getClosestPoints (const MinkowskiDiff& shape, Vec3f& w0, Vec3f& w1) co
{
w0.setZero();
w1.setZero();
for(size_t i = 0; i < getSimplex()->rank; ++i)
for(short 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);
size_t k = 0;
for(size_t i = 0; i < curr_simplex.rank; ++i)
short k = 0;
for(short 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);
size_t k = 0;
for(size_t i = 0; i < curr_simplex.rank; ++i)
short k = 0;
for(short 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(size_t i = 0; i < curr_simplex.rank; ++i)
for(short i = 0; i < curr_simplex.rank; ++i)
{
if(project_res.encode & (1 << i))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment