mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Added mat4 access tests
This commit is contained in:
parent
d1571fd15f
commit
840c3d44f4
@ -48,12 +48,40 @@ int test_mat4x4_col_get()
|
||||
|
||||
int test_mat4x4_row_set()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
glm::mat4 m(1);
|
||||
|
||||
glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
|
||||
glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
|
||||
glm::row(m, 2, glm::vec4( 8, 9, 10, 11));
|
||||
glm::row(m, 3, glm::vec4(12, 13, 14, 15));
|
||||
|
||||
Error += glm::row(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
|
||||
Error += glm::row(m, 0) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
|
||||
Error += glm::row(m, 0) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
|
||||
Error += glm::row(m, 0) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_mat4x4_col_set()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
glm::mat4 m(1);
|
||||
|
||||
glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
|
||||
glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
|
||||
glm::column(m, 2, glm::vec4( 8, 9, 10, 11));
|
||||
glm::column(m, 3, glm::vec4(12, 13, 14, 15));
|
||||
|
||||
Error += glm::column(m, 0) == glm::vec4( 0, 1, 2, 3) ? 0 : 1;
|
||||
Error += glm::column(m, 0) == glm::vec4( 4, 5, 6, 7) ? 0 : 1;
|
||||
Error += glm::column(m, 0) == glm::vec4( 8, 9, 10, 11) ? 0 : 1;
|
||||
Error += glm::column(m, 0) == glm::vec4(12, 13, 14, 15) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int main()
|
||||
@ -61,7 +89,7 @@ int main()
|
||||
int Error = 0;
|
||||
|
||||
Error += test_mat4x4_row_get();
|
||||
Error += test_mat4x4_col_set();
|
||||
Error += test_mat4x4_col_get();
|
||||
Error += test_mat4x4_row_set();
|
||||
Error += test_mat4x4_col_set();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user