From 2f7b8cfb0c48b600ebd80bdfb3ef9f04410b0b91 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Fri, 31 May 2019 17:05:22 +0200 Subject: Use references for Colision trait implementations --- game_server/src/maths.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'game_server/src/maths.rs') diff --git a/game_server/src/maths.rs b/game_server/src/maths.rs index a55c5ce..f5ceab4 100644 --- a/game_server/src/maths.rs +++ b/game_server/src/maths.rs @@ -75,8 +75,8 @@ impl std::ops::Add for Box { type Output = Self; fn add(self, other: Vec2) -> Self { Self { - p1: self.p1 + other, - p2: self.p2 + other, + pos: self.pos + other, + size: self.size + other, } } } @@ -104,8 +104,8 @@ impl std::ops::Add for RBox { type Output = Self; fn add(self, other: Vec2) -> Self { Self { - pos: self.p1 + other, - size: self.p2 + other, + pos: self.pos + other, + size: self.size + other, w: self.w, } } @@ -115,8 +115,8 @@ impl std::ops::Sub for RBox { type Output = Self; fn sub(self, other: Vec2) -> Self { Self { - pos: self.p1 + other, - size: self.p2 + other, + pos: self.pos + other, + size: self.size + other, w: self.w, } } -- cgit v1.2.3-54-g00ecf