diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-05-31 17:05:22 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-05-31 17:05:22 +0200 |
commit | 2f7b8cfb0c48b600ebd80bdfb3ef9f04410b0b91 (patch) | |
tree | e618dff4fc6d211eaea795a537097f5964bcf029 /game_server/src/maths.rs | |
parent | c1e589d622ebb2e2209e2e984d141d185d32ee87 (diff) |
Use references for Colision trait implementations
Diffstat (limited to 'game_server/src/maths.rs')
-rw-r--r-- | game_server/src/maths.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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<Vec2> 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<Vec2> 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<Vec2> 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, } } |