Skip to content

Instantly share code, notes, and snippets.

local ffi = require("ffi")
local new = ffi.new
--[[
All numeric calculations are performed with doubles. Using
floats for storage saves memory (for big arrays). But arithmetic
is usually slower due to the required float<->double conversions.
]]
local Matrix
local MatrixStructure = ffi.typeof("double[16]")