Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.48 KB

README.md

File metadata and controls

41 lines (32 loc) · 1.48 KB

TVec

Pooled, FFI-ed 2D vector library for Lua.

Design

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.

Installation

Copy TVec.lua into your project and require it. Ex. Vec2 = require "TVec"

Documentation

See the documentation.

Todo

  • Projection.
  • Cross product.
  • Mirroring.
  • Angle between two vectors.
  • Linear interpolation.

Testing

TVec uses lust for it's unit tests.
To run the unit tests

  1. Place lust beside the tests.lua file, a simple way to do that would be to run, git clone https://github.com/bjornbytes/lust
  2. Run, luajit tests.lua or lua 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.

Feedback

I will very much appreciate suggestions, bug reports and general feedback from you, you can provide your input here.

License

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.)