bnoazx005 / TDEngine2

TDEngine2 is a cross-platform game engine
Apache License 2.0
18 stars 4 forks source link

[Bug] TMatrix4::Inverse returns a zero matrix #66

Closed bnoazx005 closed 3 years ago

bnoazx005 commented 3 years ago

Bug report

For the given matrix

-0.00119 | 0.020798 | 0.002501 | 0.557742
0.000543 | -0.002474 | 0.020828 | -0.37197
-0.020941 | -0.001246 | 0.000398 | -0.154284
0 | 0 | 0 | 1

TMatrix4::Inverse returns zero one

Environment

Win 10 (x64) / Visual Studio 2017 / TDEngine2-v0.4 / NVidia GTX 860M

Steps to reproduce the issue

1, Invoke TMatrix4::Inverse for the matrix above

What's the expected result?

The result looks like the following

-2.7030233485703787 | 1.2335401999704172 | -47.567622839721947992 | -5.3724935255423248
47.243594390800585992 | -5.61886592984538721 | -2.83037684565965057 | -28.87646824389424264
5.6821775591086213437 | 47.312709494957680793 | 0.90392101429839841802 | 14.56918002443706194
0 | 0 | 0 | 1

What's the actual result?

A matrix with all zeros

bnoazx005 commented 3 years ago

Fixed in 2ccf591eb72164ac33a44020afd968286bf97eab