1
0
mirror of git://repo.or.cz/rocks.git synced 2025-01-01 14:00:30 +01:00

Renamed veins to pipes.

This commit is contained in:
Tomáš Brada 2015-05-11 11:18:15 +02:00
parent b203d77ffe
commit 1de45a1dd4
2 changed files with 9 additions and 9 deletions

View File

@ -30,14 +30,14 @@ dofile(modpath.."/ign.lua")
dofile(modpath.."/skarn.lua")
dofile(modpath.."/pegmatite.lua")
dofile(modpath.."/gensed.lua")
dofile(modpath.."/veins.lua")
dofile(modpath.."/pipes.lua")
minetest.register_on_generated(function(minp,maxp,seed)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
rocksl.gensed(minp,maxp,seed,vm,area)
--rocksl.genign
rocksl.genvein(minp,maxp,seed,vm,area)
rocksl.genpipe(minp,maxp,seed,vm,area)
vm:write_to_map(data)
end)

View File

@ -1,4 +1,4 @@
-- experimental fast vein generator
-- experimental fast pipe generator
local pr
@ -14,7 +14,7 @@ local function draw_sphere(data,area,pos,radius,with)
end end end
end
rocksl.genvein=function(minp,maxp,seed,vm,area)
rocksl.genpipe=function(minp,maxp,seed,vm,area)
local t1 = os.clock()
local data = vm:get_data()
@ -26,9 +26,9 @@ rocksl.genvein=function(minp,maxp,seed,vm,area)
local c_sample=minetest.get_content_id("default:mese")
local sample_scarcity=8
local numveins_raw=(chunksize/sample_scarcity)
local numveins = math.floor(numveins_raw + (pr:next(0,99)/100))
print("numveins="..numveins.." raw="..numveins_raw)
local numpipes_raw=(chunksize/sample_scarcity)
local numpipes = math.floor(numpipes_raw + (pr:next(0,99)/100))
print("numpipes="..numpipes.." raw="..numpipes_raw)
print("pr="..pr:next().." seed="..seed)
print("minp="..minp.x..","..minp.y..","..minp.z)
print("maxp="..maxp.x..","..maxp.y..","..maxp.z)
@ -36,7 +36,7 @@ rocksl.genvein=function(minp,maxp,seed,vm,area)
local pointA=vector.new(pr:next(0,chunksizer)+minp.x,pr:next(0,chunksizer)+minp.y,pr:next(0,chunksizer)+minp.z)
draw_sphere(data,area,pointA,5,c_sample)
for vc=1, numveins do
for vc=1, numpipes do
--local pointA=vector.new(pr:next(0,chunksizer)+minp.x,pr:next(0,chunksizer)+minp.y,pr:next(0,chunksizer)+minp.z)
local pointB=vector.new(pr:next(0,chunksizer)+minp.x,pr:next(0,chunksizer)+minp.y,pr:next(0,chunksizer)+minp.z)
local pointC=vector.new(pr:next(0,chunksizer)+minp.x,pr:next(0,chunksizer)+minp.y,pr:next(0,chunksizer)+minp.z)
@ -58,5 +58,5 @@ rocksl.genvein=function(minp,maxp,seed,vm,area)
end
vm:set_data(data)
minetest.log("action", "rocks/genvein/ "..math.ceil((os.clock() - t1) * 1000).." ms ")
minetest.log("action", "rocks/genpipe/ "..math.ceil((os.clock() - t1) * 1000).." ms ")
end