Skip to content

Commit

Permalink
test matrix4::perspective
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Nov 7, 2024
1 parent b01ef2a commit 2c11b3b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/testmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,17 @@ namespace
assert(m.d == vec4(0,0,1,0));
}

void test_matrix4_perspective()
{
std::printf("testing matrix4 perspective\n");
matrix4 m;
m.perspective(90,1,-1,1);
assert(m.a == vec4(1,0,0,0));
assert(m.b == vec4(0,1,0,0));
assert(m.c == vec4(0,0,0,-1));
assert(m.d == vec4(0,0,1,0));
}

void test_matrix4_ortho()
{
std::printf("testing matrix4 ortho\n");
Expand Down Expand Up @@ -1453,6 +1464,7 @@ testing matrices\n\
test_matrix4_jitter();
test_matrix4_transpose();
test_matrix4_frustum();
test_matrix4_perspective();
test_matrix4_ortho();
test_matrix4_transposedtransformnormal();
test_matrix4_transposedtransform();
Expand Down

0 comments on commit 2c11b3b

Please sign in to comment.