rotate_by_quat.h 618 B

1234567891011121314151617181920212223242526
  1. #ifndef IGL_ROTATE_BY_QUAT_H
  2. #define IGL_ROTATE_BY_QUAT_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Compute rotation of a given vector/point by a quaternion
  7. // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w),
  8. // such that q = x*i + y*j + z*k + w
  9. // Inputs:
  10. // v input 3d point/vector
  11. // q input quaternion
  12. // Outputs:
  13. // out result of rotation, allowed to be same as v
  14. template <typename Q_type>
  15. IGL_INLINE void rotate_by_quat(
  16. const Q_type *v,
  17. const Q_type *q,
  18. Q_type *out);
  19. };
  20. #ifdef IGL_HEADER_ONLY
  21. # include "rotate_by_quat.cpp"
  22. #endif
  23. #endif