vrld/hump — pull request #11 by tedajax (2013-01-20 22:56:23+00:00)
Title: Some adjustments to vector

The changes I made are as follows:

1) The dist function was not working properly. It was written as function vector.dist(a, b) which would not work. I changed it to local function dist(a, b) and added an entry for it in the vector table.

2) I also defined local function lerp(a, b, t) which linearly interpolates between a and b based on t (t = 0 returns a, t = 1 returns b). I also added an entry for this into the table

3) Added 'constants' into the table; zero = new(0, 0), one = new(1, 1), unit_x = new(1, 0), unit_y = new(0, 1). This is something I picked up from working with XNA and Unity and it's nice to have here

4) Renamed the _inplace functions to be more direct. So the 'pure' functions are normalized and rotated and the impure functions are normalize and rotate

HUMP is great by the way! These are just some changes I made for my own benefit and I just wanted to see if you'd like to incorporate them into the main release.

Thanks