You can see how the link is visible trough terrain...
Code: Select all
local function DrawLinks()
--Give Color to Link
local r, g, b = 0, 1, 1
glColor(r, g, b, LINK_ALPHA)
for _, node in spairs(SYNCED.NodeList) do
parent = node.parent or {}
if node.ready and parent.ready then
Visible = Spring.IsUnitVisible(node.id, 30, false)
if Visible then
--Calculate positions
local ux, uy, uz, ud, ox, oy, oz, od = CalcLink(node.id, parent.id)
--Let's draw links betwen nodes
gl.BeginEnd(GL_TRIANGLE_STRIP, DrawLink, ux, uy, uz, ud, ox, oy, oz, od, 1)
end
end
end
glColor(1, 1, 1, 1)
end