Use # operator for vector length

This commit is contained in:
Quinn
2021-12-28 15:53:58 -08:00
parent 491d94d647
commit f473777684
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ ball = {
for b in all(balls) do
if (b.id != self.id and (collisions[b] == nil or collisions[b][self] == nil)) then
local diff = self.pos - b.pos
if (diff:length() < self.rad + b.rad) then
if (#diff < self.rad + b.rad) then
collisions[self] = collisions[self] or {}
collisions[self][b] = diff
end