Skip to content

Commit

Permalink
ecology3: Print added particle count. (disabled) water fountain
Browse files Browse the repository at this point in the history
  • Loading branch information
warmist committed May 28, 2019
1 parent 7515575 commit 4e96d67
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions projects/ecology3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local win_w=768
local win_h=768

__set_window_size(win_w,win_h)
local oversample=0.5
local oversample=0.25

local map_w=math.floor(win_w*oversample)
local map_h=math.floor(win_h*oversample)
Expand All @@ -30,7 +30,7 @@ local size=STATE.size

is_remade=false
local max_particle_count=win_w*win_h
current_particle_count= 10000
current_particle_count= 1500
function update_buffers()
if particles_pos==nil or particles_pos.w~=max_particle_count then
particles_pos=make_flt_half_buffer(max_particle_count,1)
Expand Down Expand Up @@ -274,7 +274,6 @@ function resolve_intersects( )

end
end

intersect_list={}

end
Expand All @@ -300,6 +299,7 @@ function reserve_particle_id( )
return 0
end
add_list={}
add_count=0
function add_particle( p )
local id=reserve_particle_id()
particles_pos:set(id,0,{p[1],p[2]})
Expand Down Expand Up @@ -332,6 +332,7 @@ function resolve_adds( )
for i,v in ipairs(add_list) do
add_particle(v)
end
add_count=#add_list
add_list={}
end
function particle_step( )
Expand Down Expand Up @@ -504,12 +505,14 @@ function update()
end
if not config.pause then
sim_tick()
--add_particle{map_w/2,0,math.random()*0.25-0.125,math.random()-0.5,3}
end
imgui.SameLine()
if imgui.Button("Save") then
need_save=true
end
imgui.Text(string.format("Intesects:%d",int_count))
imgui.Text(string.format("Added particles:%d",add_count))
imgui.End()
__render_to_window()

Expand Down

0 comments on commit 4e96d67

Please sign in to comment.