mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2025-07-29 05:50:21 +02:00
Removed useless functions get_point_location and geometry.area
This commit is contained in:
11
geometry.lua
11
geometry.lua
@ -28,18 +28,7 @@ local function transform_quadri(X, Y, x, y)
|
||||
return xc, yc
|
||||
end
|
||||
|
||||
local function area(X, Y) -- Signed area of polygon, in function of direction of rotation. Clockwise = positive.
|
||||
local n = #X
|
||||
local sum = X[1]*Y[n] - X[n]*Y[1]
|
||||
for i=2, n do
|
||||
sum = sum + X[i]*Y[i-1] - X[i-1]*Y[i]
|
||||
end
|
||||
|
||||
return sum/2
|
||||
end
|
||||
|
||||
return {
|
||||
distance_to_segment = distance_to_segment,
|
||||
transform_quadri = transform_quadri,
|
||||
area = area,
|
||||
}
|
||||
|
5
init.lua
5
init.lua
@ -49,11 +49,6 @@ local function index(x, z)
|
||||
return z*X+x+1
|
||||
end
|
||||
|
||||
local function get_point_location(x, z)
|
||||
local i = index(x, z)
|
||||
return x+offset_x[i], z+offset_z[i]
|
||||
end
|
||||
|
||||
local function interp(v00, v01, v11, v10, xf, zf)
|
||||
local v0 = v01*xf + v00*(1-xf)
|
||||
local v1 = v11*xf + v10*(1-xf)
|
||||
|
Reference in New Issue
Block a user