API will need a major overhaul as we have upgraded lua 5.3.5 and vector2, vector3, vector4, quat libraries are now proper objects.
This means simple math like so is possible:
- Code: Select all
bounds = aabb.new( vector3.new(10.5,10.7,10.9), vector3.new(21,100,21));
bounds2 = aabb.new( vector3.new(0.5,0.7,0.9), vector3.new(2,10,1));
p1 = bounds:getCenter();
p2 = bounds2:getCenter();
_d = p2 - p1; -- calculate direction
_d:normalise(); -- normalise the vector3 internally.. note the use of ":"(colon) to have self automatically passed through.
_d = -_d; -- unary minus to flip the vector. same as _d = _d * vector3.new(-1,-1,-1)
lprint("direction: "..tostring(_d));
_d = vector3.ZERO();
_d.x()
oh and of course we have added some new libraries also like the aabb library and a query library.
Because of lua 5.3.5 it also means we now have access to the bitwise and debug libraries of lua too..
Lots and lots of changes.. there will be porting notes.