From 4cdb0d88a065df2456b3e12389836eebc9b2fa4a Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Fri, 31 May 2019 16:40:00 +0200 Subject: Fix issues in Collide --- game_server/src/maths.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'game_server/src/maths.rs') diff --git a/game_server/src/maths.rs b/game_server/src/maths.rs index 8844c6e..a55c5ce 100644 --- a/game_server/src/maths.rs +++ b/game_server/src/maths.rs @@ -93,10 +93,10 @@ impl std::ops::Sub for Box { pub struct RBox { /// Point 1 - pub p1: Vec2, + pub pos: Vec2, /// Point 2 - pub p2: Vec2, - /// Width + pub size: Vec2, + /// Width Attention manhatten distance!!! pub w: f32, } @@ -104,8 +104,8 @@ impl std::ops::Add for RBox { type Output = Self; fn add(self, other: Vec2) -> Self { Self { - p1: self.p1 + other, - p2: self.p2 + other, + pos: self.p1 + other, + size: self.p2 + other, w: self.w, } } @@ -115,8 +115,8 @@ impl std::ops::Sub for RBox { type Output = Self; fn sub(self, other: Vec2) -> Self { Self { - p1: self.p1 + other, - p2: self.p2 + other, + pos: self.p1 + other, + size: self.p2 + other, w: self.w, } } -- cgit v1.2.3-54-g00ecf