A light math library written in Lua.
- vector2
- vector3
- color3
- matrix4
local a = lmath.vector3.new(1,2,3)
print(a) --1 2 3
local b = lmath.vector3.new()
b:set(4,5,6) --Sets b's components to x=4,y=5,z=6. You can also set them manually (Ex: b.x=4)
print(b) --4 5 6
a:add(b) --Performs the operation on object a
print(a) --5 7 9
local c=a+b --You can use overloaded operators but it will create a new object each time.
You can find more details from the wiki.
This software is free to use. You can modify it and redistribute it under the terms of the MIT license. Check LICENSE for further details.