mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Code cleanup
This commit is contained in:
parent
b259e75208
commit
4f03a71f59
@ -116,14 +116,14 @@ end
|
||||
|
||||
function vector:normalize_inplace()
|
||||
local l = self:len()
|
||||
if l > 0 then self.x, self.y = self.x / l, self.y / l end
|
||||
if l > 0 then
|
||||
self.x, self.y = self.x / l, self.y / l
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
function vector:normalized()
|
||||
local l = self:len()
|
||||
if l == 0 then return self end
|
||||
return self / l
|
||||
return self:clone():normalize_inplace()
|
||||
end
|
||||
|
||||
function vector:rotate_inplace(phi)
|
||||
|
Loading…
Reference in New Issue
Block a user