• 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/mat_operations.hpp>
7 #include <boost/qvm/vec_operations.hpp>
8 #include <boost/qvm/vec.hpp>
9 #include <boost/qvm/vec_mat_operations.hpp>
10 #include <boost/qvm/vec_access.hpp>
11 #include <boost/qvm/map_mat_mat.hpp>
12 #include <boost/qvm/map_mat_vec.hpp>
13 #include <boost/qvm/swizzle.hpp>
14 #include "test_qvm_matrix.hpp"
15 #include "test_qvm_vector.hpp"
16 #include "test_qvm.hpp"
17 
18 namespace
19     {
20     void
test()21     test()
22         {
23         using namespace boost::qvm;
24         test_qvm::matrix<M1,4,4> m=rot_mat<4>(test_qvm::vector<V1,3>(1,0),1.0f);
25         X(col<3>(m)) = 42;
26         Y(col<3>(m)) = 42;
27         Z(col<3>(m)) = 42;
28         test_qvm::vector<V1,3> v(42,1);
29         test_qvm::vector<V1,3> mv=transform_vector(m,v);
30         test_qvm::vector<V1,3> mp=transform_point(m,v);
31         test_qvm::vector<V1,3> v3=del_row_col<3,3>(m) * v;
32         test_qvm::vector<V1,3> v4=XYZ(m*XYZ1(v));
33         BOOST_QVM_TEST_EQ(mv.a,v3.a);
34         BOOST_QVM_TEST_EQ(mp.a,v4.a);
35         }
36     }
37 
38 int
main()39 main()
40     {
41     test();
42     return boost::report_errors();
43     }
44