diff --git a/res/modules/internal/maths_inline.lua b/res/modules/internal/maths_inline.lua index 36c0aecfe..ecb77df97 100644 --- a/res/modules/internal/maths_inline.lua +++ b/res/modules/internal/maths_inline.lua @@ -238,3 +238,17 @@ function vec2.mix(a, b, t, dest) } end end + +function mat4.idt(dst) + if dst then + for i=1,16 do + dst[i] = (i % 5 == 1) and 1 or 0 + end + end + return { + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + } +end