Change mag to length

This commit is contained in:
Quinn
2021-12-28 15:40:08 -08:00
parent 2949f0caec
commit 491d94d647
4 changed files with 26 additions and 30 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):mag() < self.rad + b.rad) then
if (diff:length() < self.rad + b.rad) then
collisions[self] = collisions[self] or {}
collisions[self][b] = diff
end