-- green line
love.graphics.line(startLocation.x, startLocation .y, endLocatioin.x, endLocatioin.y)
i then do the following, and get all shapes within that range, then loop just those checking if they inertsect with my line
for shape in pairs(hc:shapesInRange(startLocation, endLocatioin) do
local inter = shape:intersectsRay(startLocation.x, startLocation.y, endLocatioin.x, endLocatioin.y)
if inter then
local sx, sy = shape:center()
-- red line
love.graphics.line(startLocation.x, startLocation.y, sx, sy)
end
end
the first Green line draws correctly
then the red lines draw correctly, bar 1 shape which always gets "intersected" even though it is no where near the Green line
it is within the shapesInRange() but it does not get intersected at all - that I can see
Not sure if this is a bug, or I'm misunderstanding something?
Great lib either way, I use your hump lib all the time ! : )
I have a startLocation and endLocatioin
-- green line love.graphics.line(startLocation.x, startLocation .y, endLocatioin.x, endLocatioin.y)
i then do the following, and get all shapes within that range, then loop just those checking if they inertsect with my line
for shape in pairs(hc:shapesInRange(startLocation, endLocatioin) do local inter = shape:intersectsRay(startLocation.x, startLocation.y, endLocatioin.x, endLocatioin.y) if inter then local sx, sy = shape:center() -- red line love.graphics.line(startLocation.x, startLocation.y, sx, sy) end end
the first Green line draws correctly then the red lines draw correctly, bar 1 shape which always gets "intersected" even though it is no where near the Green line it is within the shapesInRange() but it does not get intersected at all - that I can see
Not sure if this is a bug, or I'm misunderstanding something?
Great lib either way, I use your hump lib all the time ! : )