summaryrefslogtreecommitdiff
path: root/src/astroid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/astroid.rs')
-rw-r--r--src/astroid.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/astroid.rs b/src/astroid.rs
index 25029ca..ffdeabf 100644
--- a/src/astroid.rs
+++ b/src/astroid.rs
@@ -22,7 +22,7 @@ impl Astroid {
.take(8)
.collect();
let mut pr = Range::new(-50.0, 50.0);
- let mut vr = Range::new(-1.0, 1.0);
+ let mut vr = Range::new(-0.5, 0.5);
let mut rng = rand::thread_rng();
let position = (pr.sample(&mut rng), pr.sample(&mut rng), pr.sample(&mut rng));
let velocity = (vr.sample(&mut rng), vr.sample(&mut rng), vr.sample(&mut rng));
@@ -58,6 +58,10 @@ impl Mass for Astroid {
self.position.2 += self.velocity.2;
}
+ 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;