I'am using addDrawingObject to draw my lines and check them for collision with another lines, nodes and obstacles. Even though it works mostly fine, anytime that the number of lines reaches 70, I'am greeted with a "Entity does not exist" error.
My nodes_list is a list made of the handle returned by sim.createDummy.
Code: Select all
function drawLine(x1, y1, x2, y2)
local validNode = false
local pos_vec = {x1, y1, 0, x2, y2, 0}
line = sim.addDrawingObject(sim.drawing_lines, 1 , 0.0, -1, 1, {0, 0, 255})
--print("line:", line)
sim.addDrawingObjectItem(line|sim.handleflag_addmultiple, pos_vec)
table.insert(lista_linhas, line)
validNode = isLineColliding()
return validNode
end
Code: Select all
function isLineColliding(line)
local lineColliding = false
for i=1, #nodes_list do
print("index", i)
print(nodes_list[1])
print(line)
colliding, _ = sim.checkCollision(line, nodes_list[i])
if colliding == 1 then
--print("colliding with another node")
break
lineColliding = true
else
lineColliding = false
end
end
printing the results of index, nodes_list and line always give me the same thing: