fixed matrix math order

This commit is contained in:
Synthasmagoria 2026-08-30 00:24:02 +02:00
commit 9b550856fb
5 changed files with 125 additions and 60 deletions

View file

@ -289,13 +289,13 @@ rect_get_size :: proc {rect2_get_size, irect2_get_size}
/// ## LINEAR ALGEBRA ## ///
matrix3_translate2 :: proc "contextless" (translation: v2) -> mat3 {
return {
1.0, 0.0, translation.x,
0.0, 1.0, translation.y,
0.0, 0.0, 1.0,
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
translation.x, translation.y, 1.0,
}
}
matrix3_transform_v2 :: proc(m: mat3, v: v2) -> v2 {
matrix3_transform_v2 :: proc "contextless" (m: mat3, v: v2) -> v2 {
return (m * v3{**v, 1.0}).xy
}