mat_to_quat.h 579 B

12345678910111213141516171819202122232425
  1. #ifndef IGL_MAT_TO_QUAT_H
  2. #define IGL_MAT_TO_QUAT_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Convert a OpenGL (rotation) matrix to a quaternion
  7. //
  8. // Input:
  9. // m 16-element opengl rotation matrix
  10. // Output:
  11. // q 4-element quaternion (not normalized)
  12. template <typename Q_type>
  13. IGL_INLINE void mat4_to_quat(const Q_type * m, Q_type * q);
  14. // Input:
  15. // m 9-element opengl rotation matrix
  16. template <typename Q_type>
  17. IGL_INLINE void mat3_to_quat(const Q_type * m, Q_type * q);
  18. }
  19. #ifdef IGL_HEADER_ONLY
  20. # include "mat_to_quat.cpp"
  21. #endif
  22. #endif