Skip to content

Commit

Permalink
Merge pull request g-truc#1091 from yknishidate/bugfix
Browse files Browse the repository at this point in the history
Fix tengant typo g-truc#1091
  • Loading branch information
christophe-lunarg committed Apr 20, 2022
2 parents fd265ff + c5f9b31 commit f08ee17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions glm/gtx/intersect.inl
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,19 @@ namespace glm
return false;
typename genType::value_type inv_det = typename genType::value_type(1) / det;

genType Tengant = orig - vert0;
genType Tangent = orig - vert0;

position.y = dot(Tengant, Perpendicular) * inv_det;
position.y = dot(Tangent, Perpendicular) * inv_det;
if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1))
return false;

genType Cotengant = cross(Tengant, edge1);
genType Cotangent = cross(Tangent, edge1);

position.z = dot(dir, Cotengant) * inv_det;
position.z = dot(dir, Cotangent) * 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, Cotengant) * inv_det;
position.x = dot(edge2, Cotangent) * inv_det;

return true;
}
Expand Down

0 comments on commit f08ee17

Please sign in to comment.