- Add function getAvgPoint()
- Add function getRandPointInCircle() - Add getRandomPointInPoly()
This commit is contained in:
+10
-1
@@ -48,6 +48,15 @@ do
|
||||
trigger.action.outText(text,displayTime,clearview)
|
||||
end
|
||||
|
||||
function Utils.getTableSize(table)
|
||||
local tableSize = 0
|
||||
for _,_ in pairs(table) do
|
||||
tableSize = tableSize + 1
|
||||
end
|
||||
|
||||
return tableSize
|
||||
end
|
||||
|
||||
--- Creates a deep copy of a object.
|
||||
-- Usually this object is a table.
|
||||
-- See also: from http://lua-users.org/wiki/CopyTable
|
||||
@@ -247,7 +256,7 @@ do
|
||||
radius = Utils.get2DDist(avg, zone[i])
|
||||
end
|
||||
if Utils.get2DDist(avg, zone[i]) < minR then
|
||||
minR = Utils.utils.get2DDist(avg, zone[i])
|
||||
minR = Utils.get2DDist(avg, zone[i])
|
||||
end
|
||||
end
|
||||
--log:warn('minR: $1', minR)
|
||||
|
||||
Reference in New Issue
Block a user