50 #include <gtest/gtest.h> 52 #include <ACG/Math/GLMatrixT.hh> 65 virtual void SetUp() {
69 virtual void TearDown() {
75 TEST_F(
MathTest, GLMatrixT_extract_planes ) {
77 const double cmp_eps = 1e-7;
79 const double near = 10.0;
80 const double far = 25.0;
93 EXPECT_LE(fabs(planes[0] - near), cmp_eps);
94 EXPECT_LE(fabs(planes[1] - far), cmp_eps);
102 P.
ortho(-1.0, 1.0, -1.0, 1.0, near, far);
106 EXPECT_LE(fabs(planes[0] - near), cmp_eps);
107 EXPECT_LE(fabs(planes[1] - far), cmp_eps);
void identity()
setup an identity matrix
VectorT< Scalar, 2 > extract_planes_perspective() const
extract near and far clipping planes from a perspective projection matrix
void perspective(Scalar fovY, Scalar aspect, Scalar near_plane, Scalar far_plane)
multiply self with a perspective projection matrix
VectorT< Scalar, 2 > extract_planes_ortho() const
extract near and far clipping planes from an orthographic projection matrix
bool isOrtho() const
check if the matrix is an orthographic projection matrix
bool isPerspective() const
check if the matrix is a perspective projection matrix
void ortho(Scalar left, Scalar right, Scalar bottom, Scalar top, Scalar near_plane, Scalar far_plane)
multiply self with orthographic projection matrix