From 7a4403d2a26250c82b6f089de3b56e076c69e39a Mon Sep 17 00:00:00 2001 From: tom barrett Date: Tue, 13 Mar 2018 04:58:12 -0500 Subject: -added matching velocity vector of target and creating a velocity vector to target --- src/ship.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ship.rs') diff --git a/src/ship.rs b/src/ship.rs index 7eb3ba2..c33dc6c 100644 --- a/src/ship.rs +++ b/src/ship.rs @@ -46,6 +46,13 @@ impl Ship { } } + pub fn speedup(&mut self) { + self.velocity.0 *= 1.05; + self.velocity.1 *= 1.05; + self.velocity.2 *= 1.05; + + } + pub fn range(&self) -> f64 { self.r } @@ -82,6 +89,10 @@ impl Mass for Ship { Box::new((*self).clone()) } + fn recv_velocity(&self) -> (f64, f64, f64) { + self.velocity + } + fn give_acceleration(&mut self, acceleration : (f64, f64, f64)) { self.velocity.0 += acceleration.0; self.velocity.1 += acceleration.1; -- cgit v1.2.3