mirror of
git://repo.or.cz/rocks.git
synced 2025-02-22 06:40:29 +01:00
~debug
This commit is contained in:
parent
a7278f26d8
commit
1b318ccedc
@ -29,7 +29,8 @@ depositgen.register_pipe= function(descr)
|
||||
return table.insert(regs,pipe)
|
||||
end
|
||||
|
||||
depositgen.register_pipe({
|
||||
do
|
||||
local sample_pipe_def={
|
||||
ymin=-200, ymax=-6,
|
||||
scarcity=80,
|
||||
width=4,
|
||||
@ -37,14 +38,15 @@ depositgen.register_pipe({
|
||||
scatter={
|
||||
{ scarcity=7, density=4, content="default:mese", size=2 }
|
||||
}
|
||||
})
|
||||
}
|
||||
--depositgen.register_pipe(sample_pipe_def)
|
||||
end
|
||||
|
||||
depositgen.l.ToResolve.air={name="air"}
|
||||
|
||||
local function generate(minp,maxp,pr,vm,area)
|
||||
local t1 = os.clock()
|
||||
|
||||
print("pipes on generate")
|
||||
local data = vm:get_data()
|
||||
local chunksizer = maxp.x - minp.x + 1
|
||||
local chunksize = chunksizer + 1
|
||||
@ -52,7 +54,6 @@ local function generate(minp,maxp,pr,vm,area)
|
||||
local minpxz = {x = minp.x, y = minp.z}
|
||||
|
||||
for _,descr in pairs(regs) do
|
||||
l.print(dump(descr))
|
||||
--local orepr=PseudoRandom(pr:next())
|
||||
local numpipes_raw=(chunksize/descr.scarcity)
|
||||
local numpipes = math.floor(numpipes_raw + (pr:next(0,99)/100))
|
||||
@ -63,9 +64,9 @@ local function generate(minp,maxp,pr,vm,area)
|
||||
local pointC=vector.new(pr:next(0,chunksizer)+minp.x,pr:next(0,chunksizer)+minp.y,pr:next(0,chunksizer)+minp.z)
|
||||
local step=(1.8)/(vector.distance(pointA,pointB)+vector.distance(pointB,pointC))
|
||||
|
||||
print("<a pipe> "..dump({step=step}))
|
||||
for t=0, 1, step do
|
||||
local p=vector.multiply(pointA,(1-t)^2)
|
||||
local di
|
||||
p=vector.add(p, vector.multiply(pointB,2*t*(1-t)) )
|
||||
p=vector.add(p, vector.multiply(pointC,t*t) )
|
||||
p=vector.round(p)
|
||||
@ -102,7 +103,6 @@ local function generate(minp,maxp,pr,vm,area)
|
||||
--</brush>
|
||||
--brush(data,area,p,descr.radius,content,descr.scatter,orepr)
|
||||
end
|
||||
print("</a pipe> ")
|
||||
end
|
||||
|
||||
end --</apipe>
|
||||
|
Loading…
x
Reference in New Issue
Block a user