Home | History | Annotate | Download | only in gtx
      1 ///////////////////////////////////////////////////////////////////////////////////////////////////
      2 // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
      3 ///////////////////////////////////////////////////////////////////////////////////////////////////
      4 // Created : 2005-12-21
      5 // Updated : 2009-02-19
      6 // Licence : This source is under MIT License
      7 // File    : glm/gtx/handed_coordinate_space.inl
      8 ///////////////////////////////////////////////////////////////////////////////////////////////////
      9 
     10 namespace glm
     11 {
     12 	template <typename T, precision P>
     13 	GLM_FUNC_QUALIFIER bool rightHanded
     14 	(
     15 		detail::tvec3<T, P> const & tangent,
     16 		detail::tvec3<T, P> const & binormal,
     17 		detail::tvec3<T, P> const & normal
     18 	)
     19 	{
     20 		return dot(cross(normal, tangent), binormal) > T(0);
     21 	}
     22 
     23 	template <typename T, precision P>
     24 	GLM_FUNC_QUALIFIER bool leftHanded
     25 	(
     26 		detail::tvec3<T, P> const & tangent,
     27 		detail::tvec3<T, P> const & binormal,
     28 		detail::tvec3<T, P> const & normal
     29 	)
     30 	{
     31 		return dot(cross(normal, tangent), binormal) < T(0);
     32 	}
     33 }//namespace glm
     34