Differences From
Artifact [818384c4da]:
4 4 fn.vsep = function(vec) -- separate a vector into a direction + magnitude
5 5 return vec:normalize(), vec:length()
6 6 end
7 7
8 8 -- minetest now only provides the version of this function that sqrts the result
9 9 -- which is pointlessly wasteful much of the time
10 10 fn.vdsq = function(a,b)
11 - local d = vector.subtract(v1,v2)
11 + local d = vector.subtract(a,b)
12 12 return (d.x ^ 2) + (d.y ^ 2) + (d.z ^ 2)
13 13 end
14 14
15 15 fn.vdcomp = function(dist,v1,v2) -- compare the distance between two points
16 16 -- (cheaper than calculating distance outright)
17 17 local d if v2
18 18 then d = vector.subtract(v1,v2)