Matrix.getRowToRef incorrectly handles 4th row

Hello again!
While playing around I found an issue with the Matrix.getRowToRef function, where it will incorrectly (and silently) early out if you try to fetch the 4th row from the matrix, leaving your ref unchanged.

Example: Babylon.js Playground

The error can be found in the source code here.

In that function, it checks if the row index is less than 3, while it should be less than or equal to 3, as in the other functions related to this. So probably just a typo or copy-paste error, but thought I’d let you know!

Best regards,
-Tore

ahah…

We only ever used 0 1 and 2 in the code base… I ll push a fix tonight.

Thanks a ton for the report.

will be fixed by Fix Matrix getRowToRef function by sebavan · Pull Request #14556 · BabylonJS/Babylon.js · GitHub

2 Likes