cc-stuff/augment/modules/wh.lua

25 lines
779 B
Lua

-- x-run: cd .. && scp -r ./* pneumatic-pump:htdocs/cc/augment/
return function()
local cubes = {}
while _G._running do
local el = entities
for i, cube in ipairs(cubes) do
if el[i] == nil then
cube.setSize(0.0, 0.0, 0.0)
print("entity box "..tostring(i).." unused")
end
end
for i, entity in ipairs(entities) do
if cubes[i] == nil then
cubes[i] = canvas3d.addBox(0, 0, 0)
cubes[i].setDepthTested(false)
print("Created cube for entity "..entity.name)
end
cubes[i].setPosition(entity.x, entity.y, entity.z)
cubes[i].setSize(0.25, 0.25, 0.25)
end
os.sleep(0.05)
end
end