entities - display on overlay

This commit is contained in:
kepler155c@gmail.com
2018-12-16 23:27:47 -05:00
parent c08e2a560a
commit 400ebabed3

View File

@@ -52,7 +52,7 @@ function Project:isOnScreen(x, y, d) -- determines if something is visible
return (x >= 1 and x - getCharSize(d) < self.cx) and (y >= 1 and y - getCharSize(d) < self.cy) return (x >= 1 and x - getCharSize(d) < self.cx) and (y >= 1 and y - getCharSize(d) < self.cy)
end end
function Project:draw(meta, b, text, color) function Project:drawPoints(meta, pts, text, color)
local yaw = math.rad(meta.yaw) local yaw = math.rad(meta.yaw)
local pitch = math.rad(meta.pitch) local pitch = math.rad(meta.pitch)
@@ -72,6 +72,7 @@ function Project:draw(meta, b, text, color)
return newx,newy,newz return newx,newy,newz
end end
for _, b in pairs(pts) do
local x,y,z = rotate(b.x - meta.x, -b.y + meta.y, b.z - meta.z) local x,y,z = rotate(b.x - meta.x, -b.y + meta.y, b.z - meta.z)
local d = math.sqrt(x * x + y * y + z * z) local d = math.sqrt(x * x + y * y + z * z)
@@ -88,6 +89,7 @@ function Project:draw(meta, b, text, color)
self.canvas.addDot({ x, y }, color, 32 / d) self.canvas.addDot({ x, y }, color, 32 / d)
end end
end end
end
end end
return Project return Project