Tentative fix Visual C++ build

This commit is contained in:
Groove 2018-07-29 16:13:21 +02:00
parent c53b98abb6
commit d18c7f55ec
2 changed files with 17 additions and 17 deletions

View File

@ -41,7 +41,7 @@ namespace glm
// if determinant is near zero, ray lies in plane of triangle
T const det = glm::dot(edge1, p);
vec<3, T, Q> qvec(0);
vec<3, T, Q> Perpendicular(0);
if(det > std::numeric_limits<T>::epsilon())
{
@ -54,10 +54,10 @@ namespace glm
return false;
// prepare to test V parameter
qvec = glm::cross(dist, edge1);
Perpendicular = glm::cross(dist, edge1);
// calculate V parameter and test bounds
baryPosition.y = glm::dot(dir, qvec);
baryPosition.y = glm::dot(dir, Perpendicular);
if((baryPosition.y < static_cast<T>(0)) || ((baryPosition.x + baryPosition.y) > det))
return false;
}
@ -72,10 +72,10 @@ namespace glm
return false;
// prepare to test V parameter
qvec = glm::cross(dist, edge1);
Perpendicular = glm::cross(dist, edge1);
// calculate V parameter and test bounds
baryPosition.y = glm::dot(dir, qvec);
baryPosition.y = glm::dot(dir, Perpendicular);
if((baryPosition.y > static_cast<T>(0)) || (baryPosition.x + baryPosition.y < det))
return false;
}
@ -85,7 +85,7 @@ namespace glm
T inv_det = static_cast<T>(1) / det;
// calculate distance, ray intersects triangle
distance = glm::dot(edge2, qvec) * inv_det;
distance = glm::dot(edge2, Perpendicular) * inv_det;
baryPosition *= inv_det;
return true;
@ -104,27 +104,27 @@ namespace glm
genType edge1 = vert1 - vert0;
genType edge2 = vert2 - vert0;
genType pvec = cross(dir, edge2);
genType Perpendicular = cross(dir, edge2);
float det = dot(edge1, pvec);
float det = dot(edge1, Perpendicular);
if (det > -Epsilon && det < Epsilon)
return false;
float inv_det = typename genType::value_type(1) / det;
typename genType::value_type inv_det = typename genType::value_type(1) / det;
genType tvec = orig - vert0;
genType Tengant = orig - vert0;
position.y = dot(tvec, pvec) * inv_det;
position.y = dot(Tengant, Perpendicular) * inv_det;
if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1))
return false;
genType qvec = cross(tvec, edge1);
genType Cotengant = cross(Tengant, edge1);
position.z = dot(dir, qvec) * inv_det;
position.z = dot(dir, Cotengant) * inv_det;
if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1))
return false;
position.x = dot(edge2, qvec) * inv_det;
position.x = dot(edge2, Cotengant) * inv_det;
return true;
}

View File

@ -9,9 +9,9 @@
# include <type_traits>
#endif
static glm::vec2 g1;
static glm::vec2 g2(1);
static glm::vec2 g3(1, 1);
static glm::ivec2 g1;
static glm::ivec2 g2(1);
static glm::ivec2 g3(1, 1);
static int test_operators()
{