43#include <gtest/gtest.h>
45#include <ACG/Math/GLMatrixT.hh>
58 virtual void SetUp() {
62 virtual void TearDown() {
68TEST_F(
MathTest, GLMatrixT_extract_planes ) {
70 const double cmp_eps = 1e-7;
72 const double near = 10.0;
73 const double far = 25.0;
86 EXPECT_LE(fabs(planes[0] - near), cmp_eps);
87 EXPECT_LE(fabs(planes[1] - far), cmp_eps);
95 P.
ortho(-1.0, 1.0, -1.0, 1.0, near, far);
99 EXPECT_LE(fabs(planes[0] - near), cmp_eps);
100 EXPECT_LE(fabs(planes[1] - far), cmp_eps);
bool isOrtho() const
check if the matrix is an orthographic projection matrix
VectorT< Scalar, 2 > extract_planes_ortho() const
extract near and far clipping planes from an orthographic projection matrix
void perspective(Scalar fovY, Scalar aspect, Scalar near_plane, Scalar far_plane)
multiply self with 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
VectorT< Scalar, 2 > extract_planes_perspective() const
extract near and far clipping planes from a perspective projection matrix
bool isPerspective() const
check if the matrix is a perspective projection matrix
void identity()
setup an identity matrix