starlit  Diff

Differences From Artifact [65dcc21fc6]:

To Artifact [3b6ca155c9]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local lib = ...
local fn = {}

fn.vsep = function(vec) -- separate a vector into a direction + magnitude
	return vec:normalize(), vec:length()
end

-- minetest now only provides the version of this function that sqrts the result
-- which is pointlessly wasteful much of the time
fn.vdsq = function(a,b)
	local d = vector.subtract(a,b)
	return (d.x ^ 2) + (d.y ^ 2) + (d.z ^ 2)
end

fn.vdcomp = function(dist,v1,v2) -- compare the distance between two points







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local lib = ...
local fn = {}

fn.vsep = function(vec) -- separate a vector into a direction + magnitude
	return vec:normalize(), vec:length()
end

-- luanti now only provides the version of this function that sqrts the result
-- which is pointlessly wasteful much of the time
fn.vdsq = function(a,b)
	local d = vector.subtract(a,b)
	return (d.x ^ 2) + (d.y ^ 2) + (d.z ^ 2)
end

fn.vdcomp = function(dist,v1,v2) -- compare the distance between two points