Skip to content

Commit

Permalink
Fix build when ccd_real_t == float
Browse files Browse the repository at this point in the history
libccd supports single or double precision builds.
It seems like the developers build it with double precision.
But if you actually require double precision you should check for it in the configuration.
  • Loading branch information
v4hn committed Oct 7, 2020
1 parent 7b0e701 commit 35769a2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,8 @@ static void validateNearestFeatureOfPolytopeBeingEdge(ccd_pt_t* polytope) {
// for this possibility.
const ccd_real_t v0_dist =
std::sqrt(ccdVec3Len2(&nearest_edge->vertex[0]->v.v));
const ccd_real_t plane_threshold = kEps * std::max(1.0, v0_dist);
const ccd_real_t plane_threshold =
kEps * std::max(static_cast<ccd_real_t>(1.0), v0_dist);

for (int i = 0; i < 2; ++i) {
face_normals[i] =
Expand Down

0 comments on commit 35769a2

Please sign in to comment.