Pooled, FFI-ed 2D vector library for Lua.
This library aims to take advantage of luaJIT's FFI (if avaliable) and pooling.
Although inspiration is taken from Processing's PVector and Vector.lua, the API is mostly incompatible.
Copy TVec.lua into your project and require it.
Ex. Vec2 = require "TVec"
See the documentation.
- Projection.
- Cross product.
- Mirroring.
- Angle between two vectors.
- Linear interpolation.
TVec uses lust for it's unit tests.
To run the unit tests
- Place lust beside the
tests.lua
file, a simple way to do that would be to run,git clone https://github.com/bjornbytes/lust
- Run,
luajit tests.lua
orlua tests.lua
.
Additionally, the test suite is run automatically with every commit or PR using:
- LuaJIT with jit enabled
- LuaJIT with jit disabled
- Lua5.4
See, actions for the results.
I will very much appreciate suggestions, bug reports and general feedback from you, you can provide your input here.
TVec.lua is licensed under the terms and condition of the MIT License. See LICENSE for details. (This is included at the top of TVec.lua for your convenience.)