LPGhatguy

getWithinRadius

Jun 10th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.22 KB | None | 0 0
  1. function getWithinRadius(Grid, Point, Radius)
  2.     local near = {}
  3.     for ID, GridPoint in pairs(Grid) do
  4.         if ((Point - GridPoint).magnitude <= Radius) then
  5.             table.insert(near, GridPoint)
  6.         end
  7.     end
  8.  
  9.     return near
  10. end
Advertisement
Add Comment
Please, Sign In to add comment