]>
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 "test_qvm_matrix.hpp"\r | |
8 | #include "gold.hpp"\r | |
9 | \r | |
10 | namespace\r | |
11 | {\r | |
12 | template <class T>\r | |
13 | void\r | |
14 | test_perspective_lh( T fov_y, T aspect_ratio, T z_near, T z_far )\r | |
15 | {\r | |
16 | using namespace boost::qvm;\r | |
17 | test_qvm::matrix<M1,4,4> const m=perspective_lh(fov_y,aspect_ratio,z_near,z_far);\r | |
18 | test_qvm::matrix_perspective_lh(m.b,fov_y,aspect_ratio,z_near,z_far);\r | |
19 | BOOST_QVM_TEST_CLOSE(m.a,m.b,0.000001f);\r | |
20 | }\r | |
21 | \r | |
22 | template <class T>\r | |
23 | void\r | |
24 | test_perspective_rh( T fov_y, T aspect_ratio, T z_near, T z_far )\r | |
25 | {\r | |
26 | using namespace boost::qvm;\r | |
27 | test_qvm::matrix<M1,4,4> const m=perspective_rh(fov_y,aspect_ratio,z_near,z_far);\r | |
28 | test_qvm::matrix_perspective_rh(m.b,fov_y,aspect_ratio,z_near,z_far);\r | |
29 | BOOST_QVM_TEST_CLOSE(m.a,m.b,0.000001f);\r | |
30 | }\r | |
31 | }\r | |
32 | \r | |
33 | int\r | |
34 | main()\r | |
35 | {\r | |
36 | test_perspective_lh(0.5f,1.3f,0.1f,2000.0f);\r | |
37 | test_perspective_rh(0.5f,1.3f,0.1f,2000.0f);\r | |
38 | return boost::report_errors();\r | |
39 | }\r |