From 465053d73baa8c63a4fd69a21cba04fbce39e862 Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 28 Dec 2021 14:26:11 -0800 Subject: [PATCH] Remove elasticity argument from bounce --- qphys.p8 | 5 ++--- vec2.lua | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/qphys.p8 b/qphys.p8 index 39cc2ee..79767bc 100644 --- a/qphys.p8 +++ b/qphys.p8 @@ -18,10 +18,9 @@ vec2 = { return vec2:new(self.x/mag, self.y/mag) end, - bounce = function(self, n, b) - local b = b or 1 + bounce = function(self, n) local n = n:normal() - return (n * -2 * self:dot(n) + self) * b + return n * -2 * self:dot(n) + self end, } diff --git a/vec2.lua b/vec2.lua index 38b0528..45805da 100644 --- a/vec2.lua +++ b/vec2.lua @@ -15,10 +15,9 @@ vec2 = { return vec2:new(self.x/mag, self.y/mag) end, - bounce = function(self, n, b) - local b = b or 1 + bounce = function(self, n) local n = n:normal() - return (n * -2 * self:dot(n) + self) * b + return n * -2 * self:dot(n) + self end, }