panda3d/tests/linmath/test_matrix_invert.py
rdb 838d238f6e tests: add various test cases to test egg loading and transforms
Used to track down and reproduce the issue in #228.
2018-08-12 22:14:22 +02:00

21 lines
522 B
Python

import pytest
from panda3d import core
@pytest.mark.parametrize("type", (core.Mat4, core.Mat4D))
def test_mat4_invert(type):
mat = type((1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
1, 2, 3, 1))
inv = type()
assert inv.invert_from(mat)
assert inv == type(( 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
-1, -2, -3, 1))
assert (mat * inv).is_identity()
assert (inv * mat).is_identity()