|
|
@@ -87,3 +87,39 @@ def test_mat4_invert_correct(type):
|
|
|
|
|
|
assert (mat * inv).is_identity()
|
|
|
assert (inv * mat).is_identity()
|
|
|
+
|
|
|
+
|
|
|
[email protected]("type", (core.LMatrix4d, core.LMatrix4f))
|
|
|
+def test_mat4_rows(type):
|
|
|
+ mat = type((1, 2, 3, 4,
|
|
|
+ 5, 6, 7, 8,
|
|
|
+ 9, 10, 11, 12,
|
|
|
+ 13, 14, 15, 16))
|
|
|
+
|
|
|
+ assert mat.rows[0] == (1, 2, 3, 4)
|
|
|
+ assert mat.rows[1] == (5, 6, 7, 8)
|
|
|
+ assert mat.rows[2] == (9, 10, 11, 12)
|
|
|
+ assert mat.rows[3] == (13, 14, 15, 16)
|
|
|
+
|
|
|
+ assert mat.get_row3(0) == (1, 2, 3)
|
|
|
+ assert mat.get_row3(1) == (5, 6, 7)
|
|
|
+ assert mat.get_row3(2) == (9, 10, 11)
|
|
|
+ assert mat.get_row3(3) == (13, 14, 15)
|
|
|
+
|
|
|
+
|
|
|
[email protected]("type", (core.LMatrix4d, core.LMatrix4f))
|
|
|
+def test_mat4_cols(type):
|
|
|
+ mat = type((1, 5, 9, 13,
|
|
|
+ 2, 6, 10, 14,
|
|
|
+ 3, 7, 11, 15,
|
|
|
+ 4, 8, 12, 16))
|
|
|
+
|
|
|
+ assert mat.cols[0] == (1, 2, 3, 4)
|
|
|
+ assert mat.cols[1] == (5, 6, 7, 8)
|
|
|
+ assert mat.cols[2] == (9, 10, 11, 12)
|
|
|
+ assert mat.cols[3] == (13, 14, 15, 16)
|
|
|
+
|
|
|
+ assert mat.get_col3(0) == (1, 2, 3)
|
|
|
+ assert mat.get_col3(1) == (5, 6, 7)
|
|
|
+ assert mat.get_col3(2) == (9, 10, 11)
|
|
|
+ assert mat.get_col3(3) == (13, 14, 15)
|