Closed bjornbytes closed 6 years ago
A proof of concept can be found in the math branch.
A potential plan:
lovr.math
, written in Lua. Uses LuaJIT/Lua tables (cpml/maf style).lovr.math
uses them behind the scenes but you can create your own if you want to optimize further.
lovr.graphics
and lovr.headset
(how bad can it be). Primitives accept numbers and tables/vectors as arguments. The LuaJIT version of the bindings are written in Lua and unpack their vectors into numbers and FFI those into lovrGraphics
. The C bindings are written in C and support both numbers and tables in the case where LuaJIT isn't available.
I've found the lack of a math library to be really painful. It seems that > 90% of projects end up bringing in a maf/cpml, so it makes sense to just provide it directly. Thoughts:
v.x
. Function calls likev:setX()
would be pretty heavy and annoying to work with.