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