]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/qvm/test/projection_test.cpp
1 //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
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)
6 #include <boost/qvm/mat_operations.hpp>
7 #include "test_qvm_matrix.hpp"
14 test_perspective_lh( T fov_y
, T aspect_ratio
, T z_near
, T z_far
)
16 using namespace boost::qvm
;
17 test_qvm::matrix
<M1
,4,4> const m
=perspective_lh(fov_y
,aspect_ratio
,z_near
,z_far
);
18 test_qvm::matrix_perspective_lh(m
.b
,fov_y
,aspect_ratio
,z_near
,z_far
);
19 BOOST_QVM_TEST_CLOSE(m
.a
,m
.b
,0.000001f
);
24 test_perspective_rh( T fov_y
, T aspect_ratio
, T z_near
, T z_far
)
26 using namespace boost::qvm
;
27 test_qvm::matrix
<M1
,4,4> const m
=perspective_rh(fov_y
,aspect_ratio
,z_near
,z_far
);
28 test_qvm::matrix_perspective_rh(m
.b
,fov_y
,aspect_ratio
,z_near
,z_far
);
29 BOOST_QVM_TEST_CLOSE(m
.a
,m
.b
,0.000001f
);
36 test_perspective_lh(0.5f
,1.3f
,0.1f
,2000.0f
);
37 test_perspective_rh(0.5f
,1.3f
,0.1f
,2000.0f
);
38 return boost::report_errors();