build_matrix includes weird imaginary numbers #9241
Labels
project
This issue has a sample project attached
runner-bug
In-game bugs with the "GameMaker Studio 2" runtimes
Description
making a matrix like matrix_build(0,0,0,90,0,0,1,1,1)
should make a matrix at position 0, rotated 90 degrees on the "x" axis
in gamemaker that appears like this.
specifically -4.371... so on. Appears incorrect. I think it should be 0
if you take that number and round it. It also becomes 0, depsite not being close to 0.
squaring the number however, doesn't give the result -4.371.... should give either. but gives 1.9106....
show_debug_message on the number also simply displays 0
in short, i think there is some decimal error shenanigans with how matrices are created and handled, that makes these 0's in disguise appear that can cause issues, if you need to use them directly.
Steps To Reproduce
var rotation_mat = matrix_build(0,0,0,90,0,0,1,1,1)
var odd_number = rotation_mat[5]
var rounded = round(odd_number) //becomes 0
var squared = sqr(odd_number) //becomes 1.910605....
Which version of GameMaker are you reporting this issue for?
IDE v2024.11.0.179 Runtime v2024.11.0.227
Which operating system(s) are you seeing the problem on?
Windows 10.0.19045.0
Which platform(s) are you seeing the problem on?
Windows
e86cae4a-7ab0-480a-8fcc-a736a5778e5d
The text was updated successfully, but these errors were encountered: