2023-10-12 18:14:13 +03:00
|
|
|
-- x-run: cd .. && scp -r ./* pneumatic-pump:htdocs/cc/augment/
|
|
|
|
|
|
|
|
return function()
|
|
|
|
local cubes = {}
|
|
|
|
while _G._running do
|
|
|
|
local el = entities
|
2023-10-12 20:42:25 +03:00
|
|
|
print("found "..#entities.." entities")
|
2023-10-12 18:14:13 +03:00
|
|
|
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
|