handed_coordinate_space.inl 559 B

123456789101112131415161718192021222324252627
  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