snap_to_canonical_view_quat.h 637 B

1234567891011121314151617181920212223
  1. #ifndef IGL_SNAP_TO_CANONICAL_VIEW_QUAT_H
  2. #define IGL_SNAP_TO_CANONICAL_VIEW_QUAT_H
  3. #include "igl_inline.h"
  4. // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w),
  5. // such that q = x*i + y*j + z*k + w
  6. namespace igl
  7. {
  8. // Snap a given quaternion to the "canonical quaternion" rotations.
  9. // Inputs:
  10. // q input quaternion
  11. // threshold threshold between 0 and 1, where 0 means
  12. template <typename Q_type>
  13. IGL_INLINE bool snap_to_canonical_view_quat(
  14. const Q_type q[4],
  15. const Q_type threshold,
  16. Q_type s[4]);
  17. }
  18. #ifdef IGL_HEADER_ONLY
  19. # include "snap_to_canonical_view_quat.cpp"
  20. #endif
  21. #endif