Remove elasticity argument from bounce
This commit is contained in:
@@ -18,10 +18,9 @@ vec2 = {
|
|||||||
return vec2:new(self.x/mag, self.y/mag)
|
return vec2:new(self.x/mag, self.y/mag)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
bounce = function(self, n, b)
|
bounce = function(self, n)
|
||||||
local b = b or 1
|
|
||||||
local n = n:normal()
|
local n = n:normal()
|
||||||
return (n * -2 * self:dot(n) + self) * b
|
return n * -2 * self:dot(n) + self
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,9 @@ vec2 = {
|
|||||||
return vec2:new(self.x/mag, self.y/mag)
|
return vec2:new(self.x/mag, self.y/mag)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
bounce = function(self, n, b)
|
bounce = function(self, n)
|
||||||
local b = b or 1
|
|
||||||
local n = n:normal()
|
local n = n:normal()
|
||||||
return (n * -2 * self:dot(n) + self) * b
|
return n * -2 * self:dot(n) + self
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user