• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
2 
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #include <boost/qvm/quat_access.hpp>
7 #include <boost/qvm/vec_access.hpp>
8 #include "test_qvm_quaternion.hpp"
9 
10 int
main()11 main()
12     {
13     using namespace boost::qvm;
14 
15     test_qvm::quaternion<Q1> q;
16     q.a[0]=42.0f;
17     q.a[1]=43.0f;
18     q.a[2]=44.0f;
19     q.a[3]=45.0f;
20     test_qvm::quaternion<Q1> const & qq=q;
21 
22     BOOST_TEST_EQ(X(V(qq)),q.a[1]);
23     BOOST_TEST_EQ(Y(V(qq)),q.a[2]);
24     BOOST_TEST_EQ(Z(V(qq)),q.a[3]);
25     BOOST_TEST(&X(V(q))==&q.a[1]);
26     BOOST_TEST(&Y(V(q))==&q.a[2]);
27     BOOST_TEST(&Z(V(q))==&q.a[3]);
28 
29     BOOST_TEST_EQ(S(qq),q.a[0]);
30     BOOST_TEST_EQ(X(qq),q.a[1]);
31     BOOST_TEST_EQ(Y(qq),q.a[2]);
32     BOOST_TEST_EQ(Z(qq),q.a[3]);
33     BOOST_TEST(&S(q)==&q.a[0]);
34     BOOST_TEST(&X(q)==&q.a[1]);
35     BOOST_TEST(&Y(q)==&q.a[2]);
36     BOOST_TEST(&Z(q)==&q.a[3]);
37 
38     return boost::report_errors();
39     }
40