quat_conjugate.cpp 818 B

123456789101112131415161718192021222324252627
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "quat_conjugate.h"
  9. template <typename Q_type>
  10. IGL_INLINE void igl::quat_conjugate(
  11. const Q_type *q1,
  12. Q_type *out)
  13. {
  14. out[0] = -q1[0];
  15. out[1] = -q1[1];
  16. out[2] = -q1[2];
  17. out[3] = q1[3];
  18. }
  19. #ifdef IGL_STATIC_LIBRARY
  20. // Explicit template instantiation
  21. // generated by autoexplicit.sh
  22. template void igl::quat_conjugate<double>(double const*, double*);
  23. // generated by autoexplicit.sh
  24. template void igl::quat_conjugate<float>(float const*, float*);
  25. #endif