quat_assign.hpp 981 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef BOOST_QVM_DETAIL_QUAT_ASSIGN_HPP_INCLUDED
  2. #define BOOST_QVM_DETAIL_QUAT_ASSIGN_HPP_INCLUDED
  3. // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #include <boost/qvm/config.hpp>
  7. #include <boost/qvm/enable_if.hpp>
  8. #include <boost/qvm/quat_traits.hpp>
  9. namespace boost { namespace qvm {
  10. template <class A,class B>
  11. BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
  12. typename enable_if_c<
  13. is_quat<A>::value && is_quat<B>::value,
  14. A &>::type
  15. assign( A & a, B const & b )
  16. {
  17. write_quat_element<0>(a,quat_traits<B>::template read_element<0>(b));
  18. write_quat_element<1>(a,quat_traits<B>::template read_element<1>(b));
  19. write_quat_element<2>(a,quat_traits<B>::template read_element<2>(b));
  20. write_quat_element<3>(a,quat_traits<B>::template read_element<3>(b));
  21. return a;
  22. }
  23. } }
  24. #endif