openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
749 stars 359 forks source link

Make `Matrix3` use column-major order. #1792

Closed player-03 closed 1 month ago

player-03 commented 1 month ago

What "column-major" means

Now that Matrix3 is stored as a one-dimensional array (see #1778), it's important to keep careful track of what order data is stored in. I chose column-major order because that's what GLSL uses, and it's also how Matrix4 works.

This PR swaps b and c (which had been backwards), adds documentation, and tidies up.

player-03 commented 1 month ago

I don't think this fixes the error @joshtynjala reported, though it's worth checking. Yes, b and c were swapped, but they were swapped twice: once in the constructor and once in the getter/setter. Since all existing code accessed the properties rather than the underlying array, it wouldn't matter how out of order the array was.

joshtynjala commented 1 month ago

I don't think this fixes the error @joshtynjala reported, though it's worth checking.

I confirm that it does not, but it's good that you've made things more consistent.