More warning fixes

This commit is contained in:
Jan Möbius
2016-10-28 08:59:36 +02:00
parent 7a1cad003d
commit 08160c1584
3 changed files with 9 additions and 8 deletions

View File

@@ -82,7 +82,7 @@ distPointTriangleSquared( const Point& _p,
const Point v0v1 = _v1 - _v0;
const Point v0v2 = _v2 - _v0;
const Point n = v0v1 % v0v2; // not normalized !
const double d = n.sqrnorm();
const Scalar d = n.sqrnorm();
// Check if the triangle is degenerated
@@ -94,16 +94,16 @@ distPointTriangleSquared( const Point& _p,
// these are not needed for every point, should still perform
// better with many points against one triangle
const Point v1v2 = _v2 - _v1;
const double inv_v0v2_2 = 1.0 / v0v2.sqrnorm();
const double inv_v0v1_2 = 1.0 / v0v1.sqrnorm();
const double inv_v1v2_2 = 1.0 / v1v2.sqrnorm();
const Scalar inv_v0v2_2 = static_cast<Scalar>(1.0) / v0v2.sqrnorm();
const Scalar inv_v0v1_2 = static_cast<Scalar>(1.0) / v0v1.sqrnorm();
const Scalar inv_v1v2_2 = static_cast<Scalar>(1.0) / v1v2.sqrnorm();
Point v0p = _p - _v0;
Point t = v0p % n;
typename Point::value_type s01, s02, s12;
const double a = (t | v0v2) * -invD;
const double b = (t | v0v1) * invD;
const Scalar a = (t | v0v2) * -invD;
const Scalar b = (t | v0v1) * invD;
if (a < 0)
{