handed_coordinate_space.inl 533 B

1234567891011121314151617181920212223242526
  1. /// @ref gtx_handed_coordinate_space
  2. namespace glm
  3. {
  4. template<typename T, qualifier Q>
  5. GLM_FUNC_QUALIFIER bool rightHanded
  6. (
  7. vec<3, T, Q> const& tangent,
  8. vec<3, T, Q> const& binormal,
  9. vec<3, T, Q> const& normal
  10. )
  11. {
  12. return dot(cross(normal, tangent), binormal) > T(0);
  13. }
  14. template<typename T, qualifier Q>
  15. GLM_FUNC_QUALIFIER bool leftHanded
  16. (
  17. vec<3, T, Q> const& tangent,
  18. vec<3, T, Q> const& binormal,
  19. vec<3, T, Q> const& normal
  20. )
  21. {
  22. return dot(cross(normal, tangent), binormal) < T(0);
  23. }
  24. }//namespace glm