]>
Commit | Line | Data |
---|---|---|
3a9019d9 FG |
1 | //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.\r |
2 | \r | |
3 | //Distributed under the Boost Software License, Version 1.0. (See accompanying\r | |
4 | //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r | |
5 | \r | |
6 | #include <boost/qvm/mat_operations.hpp>\r | |
7 | #include <boost/qvm/vec_operations.hpp>\r | |
8 | #include <boost/qvm/vec.hpp>\r | |
9 | #include <boost/qvm/vec_mat_operations.hpp>\r | |
10 | #include <boost/qvm/vec_access.hpp>\r | |
11 | #include <boost/qvm/map_mat_mat.hpp>\r | |
12 | #include <boost/qvm/map_mat_vec.hpp>\r | |
13 | #include <boost/qvm/swizzle.hpp>\r | |
14 | #include "test_qvm_matrix.hpp"\r | |
15 | #include "test_qvm_vector.hpp"\r | |
16 | #include "test_qvm.hpp"\r | |
17 | \r | |
18 | namespace\r | |
19 | {\r | |
20 | void\r | |
21 | test()\r | |
22 | {\r | |
23 | using namespace boost::qvm;\r | |
24 | test_qvm::matrix<M1,4,4> m=rot_mat<4>(test_qvm::vector<V1,3>(1,0),1.0f);\r | |
25 | X(col<3>(m)) = 42;\r | |
26 | Y(col<3>(m)) = 42;\r | |
27 | Z(col<3>(m)) = 42;\r | |
28 | test_qvm::vector<V1,3> v(42,1);\r | |
29 | test_qvm::vector<V1,3> mv=transform_vector(m,v);\r | |
30 | test_qvm::vector<V1,3> mp=transform_point(m,v);\r | |
31 | test_qvm::vector<V1,3> v3=del_row_col<3,3>(m) * v;\r | |
32 | test_qvm::vector<V1,3> v4=XYZ(m*XYZ1(v));\r | |
33 | BOOST_QVM_TEST_EQ(mv.a,v3.a);\r | |
34 | BOOST_QVM_TEST_EQ(mp.a,v4.a);\r | |
35 | }\r | |
36 | }\r | |
37 | \r | |
38 | int\r | |
39 | main()\r | |
40 | {\r | |
41 | test();\r | |
42 | return boost::report_errors();\r | |
43 | }\r |