forked from hkc/cc-stuff
1
0
Fork 0
cc-stuff/augment/modules/wh.lua

26 lines
826 B
Lua

-- x-run: cd .. && scp -r ./* pneumatic-pump:htdocs/cc/augment/
return function()
local cubes = {}
while _G._running do
local el = entities
print("found "..#entities.."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