quat_traits_defaults.hpp 868 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef BOOST_QVM_QUAT_TRAITS_DEFAULTS_HPP_INCLUDED
  2. #define BOOST_QVM_QUAT_TRAITS_DEFAULTS_HPP_INCLUDED
  3. /// Copyright (c) 2008-2021 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/inline.hpp>
  7. #include <boost/qvm/assert.hpp>
  8. namespace boost { namespace qvm {
  9. template <class>
  10. struct quat_traits;
  11. template <class QuatType,class ScalarType>
  12. struct
  13. quat_traits_defaults
  14. {
  15. typedef QuatType quat_type;
  16. typedef ScalarType scalar_type;
  17. template <int I>
  18. static
  19. BOOST_QVM_INLINE_CRITICAL
  20. scalar_type
  21. read_element( quat_type const & x )
  22. {
  23. return quat_traits<quat_type>::template write_element<I>(const_cast<quat_type &>(x));
  24. }
  25. };
  26. } }
  27. #endif