You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2005-12-21
  5. // Updated : 2005-12-21
  6. // Licence : This source is under MIT License
  7. // File : glm/gtx/matrix_cross_product.inl
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. namespace glm
  10. {
  11. template <typename T>
  12. GLM_FUNC_QUALIFIER detail::tmat3x3<T> matrixCross3
  13. (
  14. detail::tvec3<T> const & x
  15. )
  16. {
  17. detail::tmat3x3<T> Result(T(0));
  18. Result[0][1] = x.z;
  19. Result[1][0] = -x.z;
  20. Result[0][2] = -x.y;
  21. Result[2][0] = x.y;
  22. Result[1][2] = x.x;
  23. Result[2][1] = -x.x;
  24. return Result;
  25. }
  26. template <typename T>
  27. GLM_FUNC_QUALIFIER detail::tmat4x4<T> matrixCross4
  28. (
  29. detail::tvec3<T> const & x
  30. )
  31. {
  32. detail::tmat4x4<T> Result(T(0));
  33. Result[0][1] = x.z;
  34. Result[1][0] = -x.z;
  35. Result[0][2] = -x.y;
  36. Result[2][0] = x.y;
  37. Result[1][2] = x.x;
  38. Result[2][1] = -x.x;
  39. return Result;
  40. }
  41. }//namespace glm