quat_traits_defaults.hpp 1016 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef UUID_0595DEC2C72D11E6B6B77C2A07624D53
  5. #define UUID_0595DEC2C72D11E6B6B77C2A07624D53
  6. #include <boost/qvm/inline.hpp>
  7. #include <boost/qvm/assert.hpp>
  8. namespace
  9. boost
  10. {
  11. namespace
  12. qvm
  13. {
  14. template <class>
  15. struct quat_traits;
  16. template <class QuatType,class ScalarType>
  17. struct
  18. quat_traits_defaults
  19. {
  20. typedef QuatType quat_type;
  21. typedef ScalarType scalar_type;
  22. template <int I>
  23. static
  24. BOOST_QVM_INLINE_CRITICAL
  25. scalar_type
  26. read_element( quat_type const & x )
  27. {
  28. return quat_traits<quat_type>::template write_element<I>(const_cast<quat_type &>(x));
  29. }
  30. };
  31. }
  32. }
  33. #endif