Skip to content

Commit

Permalink
Address Sherm's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
hongkai-dai committed Jul 2, 2018
1 parent 64c9285 commit f322f5c
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,6 @@ static ccd_vec3_t supportEPADirection(const ccd_pt_t* polytope,
const ccd_pt_edge_t* edge =
reinterpret_cast<const ccd_pt_edge_t*>(nearest_feature);
dir = faceNormalPointingOutward(polytope, edge->faces[0]);
ccdVec3Normalize(&dir);
break;
}
case CCD_PT_FACE: {
Expand All @@ -1190,17 +1189,13 @@ static ccd_vec3_t supportEPADirection(const ccd_pt_t* polytope,
const ccd_pt_face_t* face =
reinterpret_cast<const ccd_pt_face_t*>(nearest_feature);
dir = faceNormalPointingOutward(polytope, face);

ccdVec3Normalize(&dir);
break;
}
}
} else {
ccdVec3Copy(&dir, &(nearest_feature->witness));
// The "dist" field in ccd_pt_el_t is actually the square of the distance.
const ccd_real_t dist = std::sqrt(nearest_feature->dist);
ccdVec3Scale(&dir, ccd_real_t(1.0) / dist);
}
ccdVec3Normalize(&dir);
return dir;
}

Expand Down

0 comments on commit f322f5c

Please sign in to comment.